Excel 2002 VBA.
I have a macro that launches an external script whenever a certain condition is met:
Shell("c:\program\script.exe")
How do I stop that running program when the condition is not met?
Excel 2002 VBA.
I have a macro that launches an external script whenever a certain condition is met:
Shell("c:\program\script.exe")
How do I stop that running program when the condition is not met?
Since Shell returns the process ID of the process you started you could try using pskill with that procedd ID to stop it:
dim pid
pid = Shell("c:\program\script.exe")
'...Do something
Shell "pskill " & pid
Shell reference: http://msdn.microsoft.com/en-us/library/xe736fyk%28VS.71%29.aspx