View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
dj dj is offline
external usenet poster
 
Posts: 92
Default How to see if a macro is running

I really like this idea. I tested it and found that the status bar is updated
throughout the refresh (which takes a couple minutes). I tried some
variations and ended up with the following:

Application.StatusBar = €śProcessing Refresh€ť
Application.ScreenUpdating = False
ActiveWorkbook.RefreshAll
Application.OnTime Now + TimeValue (€ś00:02:30€ť), €śScreenUpdate€ť

. . . the end of other referenced modules also include direction to
€śScreenUpdate€ť, although a time delay wasnt needed in modules that dont use
RefreshAll.

Sub ScreenUpdate()
Application.ScreenUpdating = True
Application.StatusBar = €śAuto Refresh Schedule is Operating€ť
End Sub

After completing the end of the 72 hour loop, I added
Application.ScreenUpdating = True
Application.StatusBar = False

Thanks for your help!


"Zone" wrote:

I'll barge in. You could use the status bar to show which macro is
in-process. Then, if one of the auxilliary macros is shown on the status
bar for an unusually long time, you'd know there's a problem. HTH, James

Sub Refresh ()
application.statusbar="Processing Refresh"
'more code
Call Macro1
application.statusbar="Processing Refresh (M1 complete)
Call Macro2
application.statusbar="Processing Refresh (M2 complete)
'more code
application.statusbar=false
End Sub

Sub Macro1()
application.statusbar="Processing Macro1"
'more code
End Sub

Sub Macro2()
application.statusbar="Processing Macro2"
'more code
End Sub

"DJ" wrote in message
...
Thanks JLatham!
I see how this lets me know when the last refresh was conducted. My
concern
has been that after initiating the 72-hr "refresh schedule" macro, I've
been
working on other macros that are called up immediately after each refresh.
Sometimes the changes I make in these referenced macros have errors, and
I'm
not sure if these errors can stop the running of the 72-hr macro.

Using now() at the start of each refresh is fine, but still means I have
to
wait until the start of the next refresh to confirm the "refresh schedule"
is
still working. Maybe the only way around this is to put another loop in
the
refresh macro that shows now() more frequently than every hour . . .

I'm new to all this, and I just thought maybe there was a place or way to
see either a progress bar, or a list of running macros the way a list of
running programs can be seen (e.g., Windows Task Manager).


"DJ" wrote:

I'm working with a user-initiated macro (Excel 2003) that conducts a
query
every hour for 72 hours. Is there a way to confirm whether or not this
macro
is running without waiting to observe it conduct it's next scheduled
query?