In this chapter, you'll learn some of the things that can go wrong in your VBA code and what you can do about them. You'll examine 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).
The chapter starts by explaining the basics of debugging. Then you'll work with the debugging tools available in VBA and practice using these tools to get the bugs out of some examples. The chapter concludes with a discussion of various ways to have your program itself respond to errors that happen during runtime.