17.2. The Different Types of Errors

You'll encounter four basic kinds of errors in your procedures:

  • Language errors

  • Compile errors

  • Runtime errors

  • Program logic errors

This section looks at these kinds of errors in turn and discusses how to prevent them. After that, you'll examine the tools VBA provides for fixing them.

17.2.1. Language Errors

The first type of error is a language error (also known as a syntax error). When you mistype a word in the Code window, omit a vital piece of punctuation, scramble a statement, or leave off the end of a construction, that's a language error. If you've worked your way through the book to this point, you've probably already made dozens of language errors as part of the learning process and through simple typos. ...

Get Mastering VBA for Microsoft Office 2007, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.