Here is a routine I found a few years back that may help. I've included a test routine (and I started excel and tested it just now) and it resulted in True. I'm using Ac2010, but have used this with 2003.
Code:
'---------------------------------------------------------------------------------------
' Procedure : IsExeRunning
' Author : James Barash(AccessD)
' Created : 3/17/2009
' Purpose : To determine if a specific program is currently running.
'---------------------------------------------------------------------------------------
' Last Modified:
'
' Inputs: The name of the program
' Dependency: N/A
'------------------------------------------------------------------------------
'
Public Function IsExeRunning(strExeName As String) As Boolean
Dim objProcesses As Object, objProcess As Object
IsExeRunning = False
Set objProcesses = GetObject("winmgmts://" & Environ$("ComputerName") _
& "/root/cimv2").ExecQuery("select * from Win32_Process")
If Not objProcesses Is Nothing Then
For Each objProcess In objProcesses
If objProcess.name = strExeName Then
IsExeRunning = True
Exit For
End If
Next
Set objProcess = Nothing
Set objProcesses = Nothing
End If
End Function
Code:
'---------------------------------------------------------------------------------------
' Procedure : jtestit
' Author : Jack
' Created : 3/17/2009
' Purpose : Test routine to ensure IsEXERunning function is working
'---------------------------------------------------------------------------------------
' Last Modified:
'
' Inputs: N/A
' Dependency: N/A
'------------------------------------------------------------------------------
'
Sub jtestit()
Dim smyEXE As String
'smyEXE = "msaccess.exe"
smyEXE = "excel.exe"
Debug.Print "Is " & smyEXE & " running: " & IsExeRunning(smyEXE)
End Sub
Debug.print output
Is excel.exe running: True