R
RB Smissaert
Have a bit of code with this simplified construction:
Sub Test()
On Error GoTo STOPTEST
Application.EnableCancelKey = xlErrorHandler
OtherSub
Do While Condition = True
DoEvents
OtherSub
DoEvents
Loop
STOPTEST:
MsgBox "Stopped Test"
End Sub
Now when I am in the Sub OtherSub the Escape key will interrupt this code
and go to STOPTEST, but not when
I am in the Do While loop and not in OtherSub.
Ctrl + Break/Pause will work in both situations.
What could be the explanation for this?
Ideally I would like the Escape key to work in both situations.
RBS
Sub Test()
On Error GoTo STOPTEST
Application.EnableCancelKey = xlErrorHandler
OtherSub
Do While Condition = True
DoEvents
OtherSub
DoEvents
Loop
STOPTEST:
MsgBox "Stopped Test"
End Sub
Now when I am in the Sub OtherSub the Escape key will interrupt this code
and go to STOPTEST, but not when
I am in the Do While loop and not in OtherSub.
Ctrl + Break/Pause will work in both situations.
What could be the explanation for this?
Ideally I would like the Escape key to work in both situations.
RBS