Chapter 15. VBA Error Handling

Error handling is one of the most commonly omitted features in Excel applications. This is not an acceptable state of affairs. The last thing you want your users to see is an unvarnished Excel or VBA runtime error. They will most surely not understand what they are seeing, and they will often panic, lose faith in your application, or both. A good error handling system does not prevent errors from occurring, but it does make errors that do occur much less distressing to your users and much easier for you to diagnose and correct.

All the errors we talk about in this chapter are runtime errors—errors that occur while your code is executing. The other type of error, the compile-time error, should not be a factor at this ...

Get Professional Excel Development: The Definitive Guide to Developing Applications Using Microsoft Excel, VBA, and .NET, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.