View Full Version : Solved: Detecting a Running Application
How would one code VBA to detect whether C:\Program Files\MyApp.exe is running? Also, if it is running, how would one terminate the application?
mancubus
03-15-2011, 04:02 PM
this may help
http://www.vbaexpress.com/kb/getarticle.php?kb_id=811
mdmackillop
03-15-2011, 04:05 PM
Word has a Tasks method. You can call on this.
Sub Test()
Dim wd As Object
Dim Tsk As String
Tsk = "MyApp.exe"
Set wd = CreateObject("word.application")
If wd.Tasks.Exists(Tsk) Then wd.Tasks(Tsk).Close
wd.Quit
Set wd = Nothing
End Sub
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.