' Change the sApp Variable to check the Application you needed
Sub Check_If_Application_Is_Open()
'Check if Instance of MS Word is Running in the machine
sApp = "Word.Application"
If IsAppRunning(sApp) = True Then
MsgBox "Application is Running"
Else
MsgBox "Application is NOT Running. Let me create my own"
' Create a new instance
Set oApp = CreateObject(, sApp)
End If
End Sub
' Generalized Function to Check if an Instance of Application is running in the machine
Function IsAppRunning(ByVal sAppName) As Boolean
Dim oApp As Object
On Error Resume Next
Set oApp = GetObject(, sAppName)
If Not oApp Is Nothing Then
Set oApp = Nothing
IsAppRunning = True
End If
End Function
' Generic Function to Check if Application is Running, Visual Basic GetObject, VBA GetObject, VB6 GetObject
