15. Debugging VBA Procedures

In This Chapter

Trapping and handling program errors

• Simple yet effective strategies for trapping errors and debugging procedures

• Debugging a procedure by pausing program execution

• Stepping through a procedure one statement at a time

• Monitoring the values of variables, properties, and expressions

• Tips for debugging and creating error-free code

It's usually easy to get short Sub and Function procedures up and running. However, as your code grows larger and more complex, errors inevitably creep in. Many of these errors—programmers call them bugs—will be simple syntax problems you can fix easily, but others will be more subtle and harder to find. For the latter—whether the errors are incorrect values being ...

Get Absolute Beginner's Guide to VBA 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.