Hi,

 

  Yes, I have had Excel.exe running a few instances without seeing any 
windows.....  Not sure why this happens, but I generally look for excel.exe in 
the running processes and terminate it that way.

 

One of the methods that I use is the WMI 
<http://www.computerperformance.co.uk/vbscript/wmi_process.htm>  approach..... 
something like this:

 

Function IsProcessRunning(strServer, strProcess)

    Dim Process, strObject

    IsProcessRunning = False

    strObject = "winmgmts://" & strServer

    For Each Process In GetObject(strObject).InstancesOf("win32_process")

    If UCase(Process.Name) = UCase(strProcess) Then

            IsProcessRunning = True

            Exit Function

        End If

    Next

End Function

 

You would simply add this to a module and reference it like:

 

 

If IsProcessRunning(<your computer name or localhost>,"excel.exe") = True then

                Excel is running

Else

                It isn't.

End if

 

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lawrence, 
Mitchell
Sent: Tuesday, March 25, 2008 9:37 AM
To: [email protected]
Subject: RE: [Talk] Method to see if an application is running

 

Will this actually check the process list, or does it only check to see if 
there is an excel window running.

 

It is possible to have excel.exe in your process list without actually having 
an excel window running.

 

 

Thank you,

Mitch Lawrence

Lead Applications Analyst

Technical Support - NPR/Automation

CHRISTUS Information Management

™: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 

 

Send a "thank you <http://intranet.christushealth.org/spiritBuck/Default.asp> " 
to someone!

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thom C. Blackwell
Sent: Tuesday, March 25, 2008 10:40 AM
To: [email protected]
Subject: RE: [Talk] Method to see if an application is running

 

Greetings,

Here goes:

Call CheckExcel - it will set a flag f("ExcelRunning")  true /false which can 
be evaluated in a script- or you could modify the routine below to suit your 
tastes.

Regards,

Thom

 

Sub checkExcel()

F("ExcelRunning") = False

Dim lw As New CListWindows

For Each h In lw.HasCaptionLike("*Excel*")

    F("ExcelRunning") = True

Exit Sub

Next h

    'if I get here - Excel is not running

F("ExcelRunning") = False

End Sub

 

Thom C. Blackwell

Product Manager

Boston Software Systems

(866) 653-5105 ex 807

www.bossoft.com <http://www.bossoft.com/> 

Sign up for my weekly webinar! 
<http://www.bostonworkstation.com/customer_center/special_events.aspx> 

 

LEGAL NOTICE Unless expressly stated otherwise, this message is confidential 
and may be privileged. It is intended for the addressee(s) only. Access to this 
E-mail by anyone else is unauthorized. If you are not an addressee, any 
disclosure or copying of the contents of this E-mail or any action taken (or 
not taken) in reliance on it is unauthorized and may be unlawful. If you are 
not an addressee, please inform the sender immediately, then delete this 
message and empty from your trash.

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lawrence, 
Mitchell
Sent: Tuesday, March 25, 2008 11:27 AM
To: [email protected]
Subject: [Talk] Method to see if an application is running

 

Good morning all. Happy spring!

 

Does anyone have a method to check running processes to see if a particular 
application is running?

 

I've got several scheduled scripts that utilize the same spreadsheet for input 
data. I would like to, when the script starts, check to see if excel.exe is 
already in the list of running processes and then take action dependent upon 
the results of that query. Action 1 if excel is already running, action 2 if it 
is not.

 

 

Thank you,

Mitch Lawrence

Lead Applications Analyst

Technical Support - NPR/Automation

CHRISTUS Information Management

™: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 



Send a "thank you <http://intranet.christushealth.org/spiritBuck/Default.asp> " 
to someone!

 



CONFIDENTIALITY NOTICE: This message and any included attachments are from 
Salinas Valley Memorial Healthcare System and are intended only for the 
addressee.  The information contained in this message is confidential and may 
constitute inside or non-public information under international, federal, or 
state securities laws.  Unauthorized forwarding, printing, copying, 
distribution, or use of such information is strictly prohibited and may be 
unlawful.  If you are not the addressee, please promptly delete this message 
and notify the sender of the delivery error by e-mail or you may call Salinas 
Valley Memorial Healthcare System's Privacy Officer in Salinas, California, 
U.S.A. at (+1) (831) 755-0751.

<<image001.jpg>>

Reply via email to