How to montiro cpu useage for a process in excel - vba

Associate
Joined
27 Jan 2005
Posts
1,395
Location
S. Yorks
I have a spreadsheet that needs to call a data processing tool - all very simple. However I want excel to stop processing whilst the data processing tool is running and then recommence ones its finished.

This should be all very simple but the data processing tool once finished prompts for the enter key to be pressed, thus from an excel point of view the process never ends until this enter key is pressed.

So how do I get excel to monitor the process that is running , specificly the cpu processing, thus when it drops to nothing cause its sat waiting I can then send the enter key and force the process to finish.

Hope someone can help.

regards,

Matt

P.S. Forgot to add its excel 2003.
 
Last edited:
Hi,

I thought the RetVal would only show current state i.e program is running or program is not running? Obviously whilst the program is waiting for the enter key it is still running, thus no chnage?


regards,

Matt
 
Finally got back to work and can try the code out...

Have put the code into a blank worksheet with just a button on, when the button is pressed it calls the waitprocess sub. Now when it is running I get an error message that just says automation error and fails at the line

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")

What have I done wrong?

Do I need to include an yadditional references?

regards,

Matt
 
Back
Top Bottom