LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default How to detect if a macro is in the middle of running

Normally the only time someone could start your code a second time would be
if you have a modeless form showing and nothing else going on. Though in
long routines with DoEvents could allow the button to call your macro, or
some event triggered by your code in turn attempting to re-run your app.

You could set a global boolean flag and exit your code if it's true, and of
course set it false when all done.

Public gbAppRunning as Boolean

Regards,
Peter T

"RocketMan" wrote in message
ups.com...
I am required to have two different ways to activate the same macro:
from a button on a sheet and when the form is opened and a certain
field has 'auto' in it. I also realized that someone might just click
the button twice. I'd like to be able to check to see if a macro is
already working if the same macro is selected again.

How can I do this?



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run a UserForm in the middle of a Macro Astello[_2_] Excel Programming 5 October 16th 06 04:04 PM
Stop running a macro in the middle of a macro gmunro Excel Programming 3 June 9th 05 06:00 PM
Detect Outlook is running Pete[_4_] Excel Programming 2 May 13th 05 05:30 PM
Procedure to detect if an application is running Bill Excel Programming 1 November 2nd 04 03:20 AM
Procedure to detect a running application and to register it. Memorieswm Excel Programming 1 November 1st 04 09:52 PM


All times are GMT +1. The time now is 12:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"