beginner123
Registered User.
- Local time
- Today, 07:51
- Joined
- Apr 13, 2013
- Messages
- 44
Hello,
I am trying to check if an application is running, for my example I am using notepad although this is not the final application to be checked.
Private Sub btncheck_Click()
Dim Notepad As Object
On Error Resume Next
Set Notepad = GetObject(, "notepad.Application")
On Error GoTo 0
If Notepad Is Nothing Then
MsgBox "Notepad is not open, open notepad and try again"
Else
'Do something else
End If
End Sub
This doesn't work, always displays message. Have also tried an API call after googling but no joy.
Has anyone a basic example or link they could share.
Many Thanks
Rob
I am trying to check if an application is running, for my example I am using notepad although this is not the final application to be checked.
Private Sub btncheck_Click()
Dim Notepad As Object
On Error Resume Next
Set Notepad = GetObject(, "notepad.Application")
On Error GoTo 0
If Notepad Is Nothing Then
MsgBox "Notepad is not open, open notepad and try again"
Else
'Do something else
End If
End Sub
This doesn't work, always displays message. Have also tried an API call after googling but no joy.
Has anyone a basic example or link they could share.
Many Thanks
Rob