The effect of
ON ERROR ...
ends as soon as one of the following is encountered:- Another
ON ERROR ...
. (Maybe in the form ofON ERROR RESUME x
orON ERROR GOTO x
) Exit Sub
/Exit Function
within the same sub/function where defined.End Sub
/End Function
of the sub/function where defined.
IS IT BAD TO USE
ON ERROR RESUME NEXT
?
Yes and No.
Don't use without knowing what the effect of this statement would be. Avoid if possible. Keep the scope short wherever not possible.
To nullify the effect of an
ON ERROR RESUME NEXT
statement, you can call ON ERROR GOTO 0