XL: Error When Macro Closes Its Own Workbook

Last reviewed: February 3, 1998
Article ID: Q108507
The information in this article applies to:
  • Microsoft Excel for Windows 95, version 7.0
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for the Macintosh, versions 5.0, 5.0a
  • Microsoft Excel 98 Macintosh Edition
  • Microsoft Excel 97 for Windows

SYMPTOMS

In Microsoft Excel, if a Microsoft Visual Basic for Applications procedure is started by an OnSheetDeactivate command and the procedure then closes the workbook in which it is contained, one of the following may occur:

  • In Microsoft Excel 97, you receive an illegal operation error.
  • In Microsoft Excel for Windows, you receive a general protection (GP) fault.
  • In Microsoft Excel for the Macintosh, you receive the following error message:

          The application "Microsoft Excel" has unexpectedly quit, because
          an error of type 1 occurred.
    

CAUSE

This behavior occurs only if a sheet is deleted by clicking Delete Sheet on the Edit menu or from the Sheet Tabs shortcut menu; it does not occur if a sheet is deactivated by switching to another sheet.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post more information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: 5.00 7.00 8.00 XL97 crash hang freeze lock-up
Keywords : kbprg PgmOthr
Version : WINDOWS: 5.0, 5.0c, 7.0, 97; MACINTOSH: 5.0, 5.0a, 98
Platform : MACINTOSH WINDOWS
Issue type : kbbug
Solution Type : kbpending


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: February 3, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.