This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Hello everyone. I wrote a vbscript that would take a given excel file, and split it into multiple csv files in a different folder directory. I then created a simple alterYX workflow with just one run command that would run this vbscript code. I can log into the server to run this code on the server Desktop installation of AtlerYX designer and it works, however if I publish an analytic app that uses this command line call it is not working. I am not receiving any kind of error from the system, the alteryx application is running and returning results with no error; however the vbscript simply isn't running. It's almost like when the vbscript is called from an application it is being skipped over.
We have our server set up to run unrestricted, so I am not sure what is causing this problem.
Does anyone have any ideas of what I should check next in order to get this to work? Thank you
I have created a folder path on the server named
C:\dataFiles\Population CSV Files
I have an xlsb file in the work folder location above. I then run the attached VBScript with the following command line option...
This will run the vbscript and it will split the xlsb file in the "work folder" location into multiple CSV files in the "population csv files" location. This works perfectly if run from the command line on the server, or even if run from Alteryx Desktop ON the server. However when run from an app in our private gallery it does not work. (nothing happens).
Let me know if you need any additional information from me to help debug this problem! :-)
P.S. I uploaded my vbscript as a txt since vbs is a restricted file type. make sure you convert it back to vbs if you want to use it in the alteryx workflow i have attached!
No files need to be there, but it seems like the mere existence of that folder solved our issue. It seems to me like it had something to do with the fact that it's a service account running when you run it in the gallery. We had the same experience as you where we could log into the server and run an app but it would have problems when we ran it in the gallery. The above folders solved our issue.
If that doesn't work, I can certainly look more into your vbs, but your description is so similar to our experience that I thought I would try this first.
i=InStrRev(FileName,".") if (i>0) then results=Mid(FileName ,1,i-1) End If
If objFSO.fileexists(strFilename) Then Call Writefile(strFilename) Else wscript.echo "no such file!" End If
Set objFSO = Nothing
Sub Writefile(ByVal strFilename) Dim objExcel Dim objWB Dim objws
Set objExcel = CreateObject("Excel.Application")
Set objWB = objExcel.Workbooks.Open(strFilename)
For Each objws In objWB.Worksheets if objws.visible<>2 Then objws.visible = True objws.Copy objExcel.ActiveWorkbook.SaveAs WScript.Arguments(1) & "\" & objws.Name & ".csv", 6 objExcel.ActiveWorkbook.Close False End If Next
Dim fso, MyFile Set fso = CreateObject("Scripting.FileSystemObject") Set MyFile = fso.CreateTextFile("C:\Data File Processing\BoA Sampling\testfile.txt", True) MyFile.WriteLine(strFilename) MyFile.Close
objWB.Close False objExcel.Quit Set objExcel = Nothing End Sub
But a very similar one that simply saves the file as another excel file (instead of looping over the sheets and creating csv files) does work.. So the code below DOES WORK....
Dim strFilename Dim objFSO Set objFSO = CreateObject("scripting.filesystemobject")
Set objFolder = objFSO.GetFolder(WScript.Arguments(0))
Set colFiles = objFolder.Files
For Each objFile in colFiles FileName=objFile.Name
Just wanted to add to this that, if you use the Run As option in your server/scheduler, you will need to make sure that the person/functional id set as the run-as also has access to the folders. I had created the folders, but the run-as is set as my manager's ID and we log into the machine with a functional ID. Only the functional ID was given access when I created the folders and applied my own Admin password. I logged into the computer with my credentials and changed the security on the folders to include my manager's run-as ID, and that finally worked. Whew.