Something like this ?
Function isRunning(strComputer As String, strName As String) As Boolean
On Error Resume Next
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process",,48)
For Each objItem in colItems
If Trim(objItem.ExecutablePath & "") <> "" Then
If LCase(objItem.Name) = LCase(strName) Then
isRunning = True
Exit Function
End If
End If
Next
isRunning = False
End Function
MsgBox "Access is running ? " & isRrunning(".", "msaccess.exe")
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.