The information in this article applies to:
SYMPTOMSWhen you run a macro in a Visual Basic for Applications project, the value for a global variable is reset to nothing (zero). CAUSEThis problem occurs when the following conditions are true:
-and- WORKAROUNDTo 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. STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. MORE INFORMATION
The scope of a variable is determined by the way you declare the variable.
In Visual Basic for Applications, you can use three kinds of variables:
procedure, module, and public. To declare a global variable, use the
Public, Dim, or Private keyword in the Declaration section of the module or
procedure.
Q141693 VBA: Scope of Variables in Visual Basic for Applications REFERENCES
For more information about Scope of a variable, click the Office Assistant,
type Scope click Search, and then click to view "Understanding Scope and
Visibility."
Q179216 OFF98: How to Use the Microsoft Office Installer Program Additional query words: OFF98
Keywords : kbprg kbdta OffVBA |
Last Reviewed: November 8, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |