Debugging Your Code and Handling Errors

Richard Mansfield · 2019

This chapter explains some of the things that can go wrong in VB developers' visual basic for applications (VBA) code and what they can do about them. It examines the types of errors that can occur, from simple typos to infinite loops to errors that occur only once in a while (intermittent bugs are usually the hardest to locate). VB developers can encounter four basic kinds of errors in their programming: language errors; compile errors; runtime errors; and program logic errors. The chapter looks at these kinds of errors in turn and discusses how to prevent them. VBA provides a solid assortment of debugging tools to help people remove the bugs from their procedures. The main windows they will employ for debugging are the Immediate window, the Locals window, and the Watch window. The chapter concludes with a discussion of various ways to have VB developers' program itself respond to errors that happen during runtime.

Read the paper · More papers on PaperTik