What is the purpose of the error handler block when using 'On Error GoTo'?

Responsive Ad Header

Question

Grade: Education Subject: Support
What is the purpose of the error handler block when using 'On Error GoTo'?
Asked by:
74 Viewed 74 Answers

Answer (74)

Best Answer
(314)
The error handler block, designated by the line label specified in 'On Error GoTo', contains code that is executed when an error is trapped. This code typically involves identifying the error, logging it, displaying a user-friendly message, and often, cleaning up resources before exiting the procedure gracefully.