Debugging Your Applications

A bug is a logical error in your code that prevents your program from operating correctly. Bugs are distinct from errors, which were covered in Chapter 20. Whereas an error can (if not trapped) prevent your program from running at all, a bug does not interfere with the program running, but rather causes it to behave improperly. A calculation producing erroneous results is one example of a bug. Data being placed in the wrong field of a database table is another bug. E-mail being sent to the wrong recipients is yet another bug. Any program has hundreds of areas where bugs can appear, and while some bugs are impossible to miss, others can be subtle and hard to detect. Unlike errors, which are caught by VBA, bugs can be ...

Get Office® XP Development with 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.