MOD2000: Error Handler Code Is Put in the Wrong Place by the VBA Error Handler Add-in (236503)
The information in this article applies to:
- Microsoft Office 2000 Developer
This article was previously published under Q236503 Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you use the VBA Error Handler add-in, the error handling code may not be inserted between the beginning and end of the procedure. If the error handling code is outside the procedure and you try to compile the project or run the procedure that calls the error handling code, you may receive the following error message:
Compile error:
Label not defined
CAUSE
You receive this error message when the last line in a module is a comment.
NOTE: You see this same behavior if any other text, such as a variable declaration, is the last line in a module, but using anything other than a comment or an End Sub/Function as the last line of a module causes an error.
RESOLUTION
If you encounter this problem, move the
End Sub
End Function
line so that it comes after the error handling code block.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft Office Developer Tools.
Modification Type: | Major | Last Reviewed: | 8/6/2002 |
---|
Keywords: | kbbug KB236503 |
---|
|