2
Excel 2002中VBA。Excel VBA - 停止運行由Shell啓動的程序?
我有一個啓動每當特定條件得到滿足外部腳本宏:
Shell("c:\program\script.exe")
如何停止正在運行的程序,當條件不滿足?
Excel 2002中VBA。Excel VBA - 停止運行由Shell啓動的程序?
我有一個啓動每當特定條件得到滿足外部腳本宏:
Shell("c:\program\script.exe")
如何停止正在運行的程序,當條件不滿足?
由於殼牌返回你開始,你可以嘗試使用pskill與procedd ID停止它的進程的進程ID:
dim pid
pid = Shell("c:\program\script.exe")
'...Do something
Shell "pskill " & pid
殼牌參考: http://msdn.microsoft.com/en-us/library/xe736fyk(VS.71).aspx