I have a similar question.  It is my understanding that you can obtain the Process ID of anything you shell out.  That is if I wanted to run a batch file and obtain the process id I could do.
 
Dim PID as Double
PID = Shell("C:\Batchfile.bat")
 
My question is now that you know the process id can you then check to see if it is still running.  I want to wait until the batch file finishes to move on with my program.  So I need to be able to determine if that PID is still active or not.
 
Thanks,
Davy

>>> "Scaccia, Kimberly" <[EMAIL PROTECTED]> 3/25/2008 12:56 PM >>>

Only works when Excel is active. I activate excel a lot to use functions and VB Code applied to my spreadsheets (ie put in formulas before Boston opens in datastation)

 

 

Kim Scaccia, System Admin

Recovery Reimbursement

Patient Business & Financial Services

Halifax Medical Center

386-226-4590 opt 1 ext 2018


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Lawrence, Mitchell
Sent: Tuesday, March 25, 2008 12:43 PM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Method to see if an application is running

 

Does this work even when excel does not have an active window actually open (IE when excel is being used by BWS)

 

 

Thank you,

Mitch Lawrence

Lead Applications Analyst

Technical Support - NPR/Automation

CHRISTUS Information Management

Send a "thank you" to someone!


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

 

I have one that checks to see if Excel is running and if it is, close it: Works beautifully:

 

Sub WaitForExcelToShutDown()

Dim obj As Object

On Error GoTo trap

Do

    Set obj = GetObject(, "Excel.Application")   'this will fail if Excel Isnt running

    obj.quit

    Set obj = Nothing

    Wait 2

Loop

 

Exit Sub

 

trap:

    'we're in the clear

   

End Sub

 

Kim Scaccia, System Admin

Recovery Reimbursement

Patient Business & Financial Services

Halifax Medical Center

386-226-4590 opt 1 ext 2018


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

Send a "thank you" to someone!

 


CONFIDENTIALITY NOTICE: This email message, including attachments,
is for the sole use of the intended recipient(s) and may contain
confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the
intended recipient, please contact the sender by reply email and
destroy all copies of the original message.


Reply via email to