How can I use 'On Error Resume Next' and still get information about the error in VBA?

Question

Grade: Education Subject: Support
How can I use 'On Error Resume Next' and still get information about the error in VBA?
Asked by:
86 Viewed 86 Answers

Answer (86)

Best Answer
(277)
You can use 'On Error Resume Next' and then immediately after the line that might cause an error, check the 'Err.Number'. If it's not 0, you can then display 'Err.Description' or take other actions based on the specific error number before clearing the error using 'Err.Clear'.