Troubleshooting

What to Do If You Get an Error Message Saying a Variable Has Not Been Defined?

You have either typed Option Explicit in the General Declarations section of your module or you have selected to require variable declarations through the Options dialog box. Because of this you have to use a Dim statement to declare your variables. You tried to use a variable that had not been declared.

What to Do When You Type the First Line of Your If Statement and You Get a Syntax Error When You Press Enter

The message you see should tell you exactly what you did wrong. It states that it expected a Then or GoTo. You forgot to type Then at the end of the first line of your If statement. This is one of the most common typos in VBA.

What to Do If the ...

Get Special Edition Using Microsoft® Word 2000 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.