Error Handling

As a general rule, you should always avoid having a user encounter a Microsoft Excel application error directly when running your add-in. While very helpful during the development process, these error messages tend to confuse nonexpert users. Instead, these errors should be trapped by error-handling code within your add-in and presented to the user in a friendlier manner. Your add-in should then exit or recover gracefully from the error. The bottom line is that a quality add-in will have very strong error handling. This requires care when creating the add-in and a healthy dose of third-party testing to verify your work. The following VBA error-handling features can assist to create a strong, user-friendly add-in.