ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   code break message box (https://www.excelbanter.com/excel-discussion-misc-queries/57724-code-break-message-box.html)

freekrill

code break message box
 

I have a code which loops until it is stopped via the esc key. When this
happens, the message box ("Code execution has been interrupted") appears
with the options to end, debug, etc. My question is: can I stop this
message from appearing? That is, when I press esc, can I just have the
page where the code was working displayed without any error messages?

Cheers
free


--
freekrill
------------------------------------------------------------------------
freekrill's Profile: http://www.excelforum.com/member.php...fo&userid=7561
View this thread: http://www.excelforum.com/showthread...hreadid=489041


Dave O

code break message box
 
Will this do it for you?
Application.DisplayAlerts = False

The only other thing I can think of is to use another method of ending
the program.


Dave Peterson

code break message box
 
Look at application.EnableCancelKey in VBA's help.



freekrill wrote:

I have a code which loops until it is stopped via the esc key. When this
happens, the message box ("Code execution has been interrupted") appears
with the options to end, debug, etc. My question is: can I stop this
message from appearing? That is, when I press esc, can I just have the
page where the code was working displayed without any error messages?

Cheers
free

--
freekrill
------------------------------------------------------------------------
freekrill's Profile: http://www.excelforum.com/member.php...fo&userid=7561
View this thread: http://www.excelforum.com/showthread...hreadid=489041


--

Dave Peterson


All times are GMT +1. The time now is 07:26 AM.

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