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!
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.
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.
Phil: This may help: Using the X and SYSTASK commands from SAS Enterprise Guide - The SAS Dummy
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.