Run STW command from Excel and Determine Success/Error
I have a SilkTest Workbench .Net script that reads commands from an Excel spreadsheet, such as START MY.EXE, OPEN DIALOG XXX, etc. The silk script will execute each of the commands. I added a button to the Excel file to run the script using the command line (wsh.Run "cmd.exe /S /C stw -s myscript", windowStyle, waitOnReturn). I want to be able to determine within the spreadsheet vba code if the silk script was successful or not. I saw some posts on checking %ERRORLEVEL% but I didn't see that env var after running the stw command. Any help is appreciated.
RE: Run STW command from Excel and Determine Success/Error
The reason that you can't get the value of %ERRORLEVEL% is because it is set within the cmd.exe process, not Excel.
This Stack Overflow question sounds like it's trying to do the same thing: https://stackoverflow.com/questions/1439200/vba-shell-and-wait-with-exit-code