tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,834
- Office Version
- 365
- 2019
- Platform
- Windows
I thought:
enables the default error checking behaviour.
If so, why does this fail?
but substituting
with
works.
Code:
On Error GoTo 0
enables the default error checking behaviour.
If so, why does this fail?
Code:
Sub Errorhandler()
On Error GoTo ErrMsg
X = 12
Y = 20 / 0
Z = 30
Exit Sub
ErrMsg:
MsgBox "There seems to be an error" & vbCrLf & Err.Description
'**********
On Error GoTo 0
'**********
On Error GoTo ErrMsg2
A = 10 / 2
B = 35 / 0
Exit Sub
ErrMsg2:
MsgBox "There seems to be an error again" & vbCrLf & Err.Description
End Sub
but substituting
Code:
On Error GoTo 0
with
Code:
On Error GoTo -1
works.