MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Ok, heres one for you guys.


Posted by Jason Davis on January 23, 2002 9:44 AM

I need to have Excel look and see if another program is running. The application is Dasylab.exe

Any suggestions?


Posted by Mark O'Brien on January 23, 2002 10:54 AM

Here's an example using MS Word as the application to be tested. I believe you should be able to modify it quite easily. Any problems, just repost.


Public Sub Main()

If Not MyAppActivate("Microsoft Word") Then
MsgBox "Application NOT running."
Else
MyAppActivate "Microsoft Excel"
MsgBox "Application running."
End If

End Sub

Public Function MyAppActivate(AppName As String) As Boolean

On Error GoTo ERR_NOT_RUNNING
AppActivate AppName, False
MyAppActivate = True
Exit Function

ERR_NOT_RUNNING:
MyAppActivate = False

End Function