View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Zone[_3_] Zone[_3_] is offline
external usenet poster
 
Posts: 373
Default How to see if a macro is running

Great! Glad to help. James

"DJ" wrote in message
...
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 wasn't needed in modules that don't
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?