Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Testing to see if windows application iis running
Dear All
In my program I use (copied) code to start the good ol' trusty windows calculator. How can I test to see whether the calculator is already running and give the user a message box to that effect if it is or start it if it isn't. (Office XP, XP Pro) If calc.exe is running then msgbox "Calculator is already running" exit sub 'Code to start the calculator end if Any suggestions TIA Mark (InWales) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Testing to see if windows application iis running
This Microsoft KB article describes how.
http://support.microsoft.com/kb/q187913/ It mentions a DLL. I think psapi.dll is now standard in Windows XP. -- Rob van Gelder - http://www.vangelder.co.nz/excel "Mark (InWales)" wrote in message ... Dear All In my program I use (copied) code to start the good ol' trusty windows calculator. How can I test to see whether the calculator is already running and give the user a message box to that effect if it is or start it if it isn't. (Office XP, XP Pro) If calc.exe is running then msgbox "Calculator is already running" exit sub 'Code to start the calculator end if Any suggestions TIA Mark (InWales) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Testing to see if windows application iis running
Hi
This is vb script code, but it runs in vba and will tell you if calculator is running or not. It does run a little slow, but works. strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colProcesses = objWMIService.ExecQuery( "select * from win32_process" ) isrunning = False For Each objProcess in colProcesses If objProcess.GetOwner ( User, Domain ) = 0 Then If objProcess.caption = "CALC.EXE" then isrunning = true exit for End If End If Next if isrunning = true then msgbox "Calculator is running" else msgbox "Calculator is not running" end if HTH Ken |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Testing to see if windows application iis running
Thank you both for your input.
Mark "Ken Macksey" wrote in message ... Hi This is vb script code, but it runs in vba and will tell you if calculator is running or not. It does run a little slow, but works. strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colProcesses = objWMIService.ExecQuery( "select * from win32_process" ) isrunning = False For Each objProcess in colProcesses If objProcess.GetOwner ( User, Domain ) = 0 Then If objProcess.caption = "CALC.EXE" then isrunning = true exit for End If End If Next if isrunning = true then msgbox "Calculator is running" else msgbox "Calculator is not running" end if HTH Ken |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Running a macro from windows application | Excel Discussion (Misc queries) | |||
How to keep userform always on the top of all windows application | Excel Discussion (Misc queries) | |||
Automation Testing in an Excel application. | Excel Discussion (Misc queries) | |||
Application.InputBox with Default:=0 testing False | Excel Programming | |||
Load Testing Tool required for Excel Pivot table based OLAP Application | Excel Programming |