Screenupdating vba msdn
If you select Debug the application stops on the error line as the screenshot below shows This behaviour is fine when you are writing VBA code as it shows you the exact line with the error.
This behavior is unsuitable for an application that you are given to a user.
This post provides a complete guide to VBA Error Handing.
If you are looking for a quick summary then check out the quick guide table in the first section.
Other examples of runtime errors are As we have seen, the purpose of error handling is to deal with runtime errors when they occur.
When we think a runtime error could occur we put code in place to handle it.
For example, we would normally put code in place to deal with a file not being found.
Before we look at the VBA Handling there is one type of error we must mention.
Some runtime errors are not considered errors by VBA but only by the user. Imagine you have an application that requires you to add the values in the variables a and b This is not a VBA error. However, from your requirements point of view it is an error.