XL5: GP Fault Closing Workbook while Macro is Recording

Last reviewed: September 12, 1996
Article ID: Q120042
The information in this article applies to:
  • Microsoft Excel for Windows, version 5.0

SYMPTOMS

In Microsoft Excel, you receive a general protection (GP) fault if you use the Close method in a Visual Basic procedure to close a workbook that contains a recording macro.

CAUSE

This problem occurs whether the recording macro is a Visual Basic macro, or a MS Excel 4.0 macro. The GP fault occurs whether you use the saveChanges argument with the Close method, or not. The problem also occurs whether or not you choose to save the changes to the workbook that contains the recording macro.

This problem does not occur if the procedure that closes the workbook and the recording macro are contained in the same workbook.

WORKAROUNDS

To avoid receiving a GP fault when you close a workbook that contains a recording macro, do either of the following:

  • Close the workbook without using a macro by choosing Close from the File menu.

    -or-

  • Stop the macro recorder before you run the macro that closes the workbook.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in a later version of Microsoft Excel.

MORE INFORMATION

For additional information, please see the following article(s) in the Microsoft Knowledge Base:

   ARTICLE-ID: Q108507
   TITLE     : XL5: Error When Macro Closes Its Own Workbook


KBCategory: kbprg
KBSubcategory:

Additional reference words: 5.00 gpf



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.