OFF97: Displaying UserForm Designer Resets Global Variables (169621)
The information in this article applies to:
- Microsoft Office 97 for Windows
- Microsoft Excel 97 for Windows
- Microsoft Word 97 for Windows
- Microsoft PowerPoint 97 for Windows
This article was previously published under Q169621 SYMPTOMS
When you run a macro in a Visual Basic for Applications project, the value
for a global variable is reset to nothing (zero).
CAUSE
This problem occurs when the following conditions are true:
- The project includes a UserForm.
-and-
- The UserForm designer is open (the UserForm is in a window).
RESOLUTION
To resolve this problem and ensure that all global variables retain their
scope, close all UserForm windows before running a macro in a Visual Basic
project.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article.
REFERENCES
For more information about how long the value of a variable is retained,
from the Visual Basic Editor, click Contents and Index on the Help menu,
click the Index tab in Microsoft Visual Basic for Applications Help, type
the following text
and then double-click the selected text to go to the "Lifetime of
variables" topic.
Modification Type: | Major | Last Reviewed: | 11/22/2000 |
---|
Keywords: | kbbug kbProgramming KB169621 |
---|
|