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