Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using code to stop a macro.

In VBA, is there any way you can write a macro that can
stop another macro currently executing. I have a macro
that loops for over 30 minutes. I would like to be able
to write another macro that allows me to neatly stop the
first macro. I can't see anything in VBA that allows you
to do this - especially since it doesn't seem possible to
launch a second macro (using a macro button) when another
macro is still executing.
Is there a work-around?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default Using code to stop a macro.

If have dominion over the long-running macro code, you can modify it to
check the status of something, like a key press, cell value or an
environment variable, and exit if the status attains a certain value. If the
macros has a form, you can implement a cancel function. But, no you cannot
start one Excel macro that will end another.

"Wrightr" wrote in message
...
In VBA, is there any way you can write a macro that can
stop another macro currently executing. I have a macro
that loops for over 30 minutes. I would like to be able
to write another macro that allows me to neatly stop the
first macro. I can't see anything in VBA that allows you
to do this - especially since it doesn't seem possible to
launch a second macro (using a macro button) when another
macro is still executing.
Is there a work-around?



Reply
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
Stop window saying code execution interrupted at startup? Jerry07 Excel Discussion (Misc queries) 1 August 15th 09 05:16 PM
How to stop printing the VB Code Result Nadeem Excel Discussion (Misc queries) 0 January 17th 07 06:52 PM
stop code execution al ramirez Excel Programming 1 August 26th 04 03:45 AM
VB Code to stop cells being deleted T Jeanes Excel Programming 2 July 8th 04 01:05 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 06:22 AM.

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

About Us

"It's about Microsoft Excel"