Debugging VBA Procedures and Handling Errors

Testing VBA Procedures ■ Stopping a Procedure ■

Using Breakpoints ■ Using the Immediate Window in Break Mode ■ Using the Stop Statement ■ Adding a Watch Expression ■ Using Quick Watch ■ Using the Locals Window and the Call Stack Dialog Box ■ Stepping through VBA Procedures ■ Stepping through a Procedure ■ Stepping Over a Procedure ■ Setting the Next Statement ■ Showing the Next Statement ■ Stopping and Resetting VBA Procedures ■ Understanding and Using Conditional Compilation ■ Navigating with Bookmarks ■ Trapping Errors ■ What's Next...

It does not take much for an error to creep into your VBA procedure. The truth is that no matter how careful you are, it is rare that all your VBA procedures will work correctly the first time. There's always something you have missed or haven't thought of. From Chapter 2, you already know that there are three types of errors in VBA: syntax errors, logic errors, and run-time errors. This chapter introduces you to many built-in tools that you'll find useful in the process of analyzing the code of your procedures and locating the source of errors.

0 0

Post a comment