ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   stopping macro (https://www.excelbanter.com/excel-programming/298126-stopping-macro.html)

DPK

stopping macro
 
I have a procedure macro that calls a dialog box. After
parameters are input, the user clicks an "Ok" button and
the macro runs. At times the procedure can take a very
long time to run. Is there a way to allow the user to
break the macro and not wait until it finishes? I have
only been able to use [CTRL][ALT][DEL] and end Excel, but
obviously that is not a very good solution. I have tried
to use the [ESC] key, but it just ignores the key press.
Maybe a status dialog box with a cancel button? Anyone
used anything they feel works well?

Thanks in advance,
Dave


tzcarmy

stopping macro
 
you can try ctrl+break, it should work

--
Message posted from http://www.ExcelForum.com


No Name

stopping macro
 
Thanks!
-----Original Message-----
you can try ctrl+break, it should work.


---
Message posted from http://www.ExcelForum.com/

.


mudraker[_218_]

stopping macro
 
I do use a stop button on a status form in some of my macros


When a user presses the stop button, code attached to the stop butto
sets a public boolan variable.

At strategic places through out my code i place code to check if th
variable is true or false taking action as required


To prevent the macro from hanging waiting for user input when th
status form is activated i use

Private Sub UserForm_Activate()
call mymacro
End Su

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 02:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com