Code execution has been interrupted
Put this as the first statement in your code:
Application.EnableCancelKey = xlDisabled
this effectively turns off the esc key, but if you have a real problem, like
a loop, you would have to ctrl/alt/delete to stop it.
"AnExpertNovice" wrote in message
...
Is there a way to prevent the "Code execution has been interrupted" error?
I'm thinking there is not, but perhaps my code is incomplete or
inadequate.
A worksheet has the following event handler: (A similar handler exists for
the workbook.)
Private Sub Worksheet_Deactivate()
'Redisplay Formula Bar when changing to another worksheet
On Error Resume Next
Application.DisplayFormulaBar = True
End Sub
When I start to Alt-Tab to change to another window and use the Esc key to
change my mind then the Esc key must be pressed a second time to avoid the
interruption error when any code is executed. Of course, code will be
executed if I change worksheets, workbooks, click a button, etc.
Any suggestions?
|