OFF97: PageSetup Object Causes Memory Leak and Hangs System

ID: Q192869


The information in this article applies to:
  • Microsoft Visual Basic for Applications version 5.0
  • Microsoft Excel for Windows 95, versions 7.0, 7.0a
  • Microsoft Excel 97 for Windows


SYMPTOMS

A procedure is written in Excel Visual Basic to set PageSetup properties of a Worksheet object. If this code is run hundreds of times, the system becomes unstable, and there is not enough memory to start other applications. In Excel, you may receive the following error messages:

An error has occurred in your program. To keep working anyway, click Ignore and save your work in a new file. To quit this program, click Close. You will lose information you entered since your last save.
Excel caused a General Protection Fault in module GDI.EXE.


CAUSE

This problem is caused by a memory leak when using the PageSetup object when a printer is installed on the system.


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

This problem does not occur on Windows NT. The problem only occurs on Windows 95 and Windows 98.

For additional information about this hotfix, please see the following article in the Microsoft Knowledge Base:

Q229670 Calling EnumObjects() Leaks a Selector

Additional query words: kbDSupport kbDSD IPF GPF KRNL386.EXE 8.0 OFF97

Keywords : KbVBA
Version : WINDOWS:5.0,7.0,7.0a,97
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: October 5, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.