Public and Module-Level Variables Lost with SaveAs Method (124224)



The information in this article applies to:

  • Microsoft Excel for Windows 95 7.0a
  • Microsoft Excel for Windows 5.0c
  • Microsoft Excel for Windows NT 5.0
  • Microsoft Excel for the Macintosh 5.0a

This article was previously published under Q124224

SYMPTOMS

In the versions of Microsoft Excel listed above, if you create a Visual Basic, Applications Edition macro, and you apply the SaveAs method to the workbook in which the code is currently running, you may lose the values for the public and module-level variables.

CAUSE

If the workbook is saved with a name that is different from the workbook's present name, the variables are reinitialized (they will not represent values).

STATUS

Microsoft has confirmed this to be a problem with Microsoft Excel versions listed above. This problem was corrected in Microsoft Excel 97 for Windows and Microsoft Excel 98 Macintosh Edition.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbbug kbcode kbfix kbProgramming KB124224