Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
After using ctr alt Break to stop a macro mid flow it continues to pop up and
break code running. Even after I have closed the workbook and try to run the code in normall fashion this error message constantly re appears. Only after pressing continue ~ 50 do we return to normall. Can only assume this is a known bug with the application - but any thoughts on resolutions / fixes. Regards, David |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
David,
Depending on how your code is written/structured, pressing Escape or Ctrl + Break will only interrupt your code not stop it. There is a "reset" button on the Standard and Debug menu bars in the VBE which will do just that. (looks like a dark square) Also, take a look in help for the "EnableCancelKey" property. Make sure to read all of the remarks. Finally, be aware that overall error handling settings are found in... Tools | Options | General (tab) in the VBE. -- Jim Cone Portland, Oregon USA "David_W" wrote in message After using ctr alt Break to stop a macro mid flow it continues to pop up and break code running. Even after I have closed the workbook and try to run the code in normall fashion this error message constantly re appears. Only after pressing continue ~ 50 do we return to normall. Can only assume this is a known bug with the application - but any thoughts on resolutions / fixes. Regards, David |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You should use the EnableCancelKey property to specify what is to be
done if the user breaks out of the code. Application.EnableCancelKey = xlDisabled ' Dangerous. You can't break out ' of a rogue loop without using CTRL ALT DELETE Application.EnableCancelKey = xlInterrupt ' Sloppy. opens the VBE on the break line. ' Users will be confused. Application.EnableCancelKey = xlErrorHandler ' Best solution: On Error GoTo ErrH: ''''' ' your code here ''''' ErrH: If Err.Number = 18 Then MsgBox "Break Key Pressed" If Err.Number < 0 Then MsgBox "Some other error" & vbCrLf & Err.Description Else ' no error. do nothing. End If Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Mon, 19 Jan 2009 01:17:02 -0800, David_W wrote: After using ctr alt Break to stop a macro mid flow it continues to pop up and break code running. Even after I have closed the workbook and try to run the code in normall fashion this error message constantly re appears. Only after pressing continue ~ 50 do we return to normall. Can only assume this is a known bug with the application - but any thoughts on resolutions / fixes. Regards, David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code Execution Has Been Interupted | Excel Programming | |||
Code has been interupted - error message | Excel Discussion (Misc queries) | |||
Macro 'Code execution has been interupted' error after print? | Excel Programming | |||
Code Execution has been interupted | Excel Discussion (Misc queries) | |||
"Code execution has been interupted" | Excel Programming |