The SAS Output Delivery System and reporting techniques

Can't run VBS scripts from within SAS

Reply
Contributor
Posts: 39

Can't run VBS scripts from within SAS

Hi guys, I am trying to use an x command to open/run a vbs script. The command is simply: options noxsync noxwait; x "F:\SAS_USER\myname\SAS2script\ext_files\VBS_TEST.vbs"; The VBS script is supposed to move data from a csv file to an excel work book and then run a macro. You can tell that it partially works, because an Excel process is started in the background. However, this excel process doesn't doesn't run any macros. When I run the very same command using command prompt, everything works fine. Has anyone ever experienced anything like this (script working in command prompt but not in SAS)? Thanks!

Esteemed Advisor
Posts: 6,900

Re: Can't run VBS scripts from within SAS

Phil: Since you indicate that it will run correctly from the command prompt, I can think of one alternative that would be easy to test, namely putting the command (to run the vb script) in a .bat file and using the x command to run the .bat file.

Contributor
Posts: 39

Re: Can't run VBS scripts from within SAS

Thanks for your response, Arthur. I tried running the batch file with the command to run the vbs script, but it still isn't working. Then I tried the same thing in SAS Base (I walys use Enterprise Guide) and it worked. I was able to run both, batch file and vbs script directly via X command using SAS Base. So it looks as if something is blocking x commands in Enterprise Guide.

BTW: I already allowed XCMD on the workspace server.

Esteemed Advisor
Posts: 6,900

Re: Can't run VBS scripts from within SAS

Post a Question
Discussion Stats
  • 3 replies
  • 1594 views
  • 0 likes
  • 2 in conversation