Skip to Content
Excel VBA Programming For Dummies, 6th Edition
book

Excel VBA Programming For Dummies, 6th Edition

by Dick Kusleika
February 2022
Beginner to intermediate content levelBeginner to intermediate
432 pages
9h 21m
English
For Dummies
Content preview from Excel VBA Programming For Dummies, 6th Edition

Chapter 12

Error-Handling Techniques

IN THIS CHAPTER

Bullet Understanding the difference between programming errors and runtime errors

Bullet Trapping and handling runtime errors

Bullet Using On Error and Resume statements

Bullet Finding out how you can use an error to your advantage

To err is human. To anticipate errors is divine. When working with VBA, you must be aware of two broad classes of errors: programming errors and runtime errors. This chapter is all about runtime errors.

A well-written program handles errors the way Fred Astaire danced: gracefully. Fortunately, VBA includes several tools to help you identify errors and then handle them gracefully.

Types of Errors

If you’ve tried any of the examples in this book, you have probably encountered one or more error messages. Some were a result of bad VBA code. For example, you might have misspelled a keyword or typed a statement using the wrong syntax. If you make such an error, you won’t even be able to execute the procedure until you correct it.

This chapter doesn’t deal with those types of errors, however. Instead, it focuses on runtime errors

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Excel VBA Programming For Dummies, 5th Edition

Excel VBA Programming For Dummies, 5th Edition

Michael Alexander, John Walkenbach

Publisher Resources

ISBN: 9781119843078Purchase Link