I was under the impression that On Error GoTo 0
reset error handling.
So why does On error resume next
not seem to be registering in the following?
Sub GetAction()
Dim WB As Workbook
Set WB = ThisWorkbook
On Error GoTo endbit:
'raise an error
Err.Raise 69
Exit Sub
endbit:
On Error GoTo 0 '<<<reset error handling?
On Error Resume Next
WB.Sheets("x").Columns("D:T").AutoFit
MsgBox "ignored error successfully and resumed next"
End Sub
You need to use
On Error GoTo -1
orErr.Clear
to reset error trapping.Check this answer I posted a few months ago for a more detailed explanation.