Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Test if application running?

Does Excel have any property similar to Tasks in Word (or object similar to
Task) that allows you to determine whether a particular app is running? I
don't want to activate the window, just determine if the app is running.
Thanks for any help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Test if application running?

Hi

Here is some vbscript code that should do what you want. I have found this
code very handy.
I found it on a web site somewhere and do not know the original author.

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



msgbox objprocess.caption



If objProcess.caption = "MSIMN.EXE" then ' replace "msimn.exe" with the
objprocess.caption you want to know about
isrunning = true ' then
comment out the msgbox line
End If


End If

Next





if isrunning = true then ' comment out the msgbox lines and
do what you want here
msgbox "Outlook Express is running"
else
msgbox "Outlook Express is not running"
end if



Just use what you need from it.


HTH

Ken


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a macro from windows application Aerojade Excel Discussion (Misc queries) 1 October 3rd 08 01:19 PM
Procedure to detect if an application is running Bill Excel Programming 1 November 2nd 04 03:20 AM
Procedure to detect a running application and to register it. Memorieswm Excel Programming 1 November 1st 04 09:52 PM
running an password protected application arno Excel Programming 0 February 27th 04 07:26 AM
Problem in running an application Mohanasundaram[_2_] Excel Programming 0 August 5th 03 08:26 AM


All times are GMT +1. The time now is 06:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"