XL: Error When Macro Closes Its Own Workbook

ID: Q108507

The information in this article applies to:

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:

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.

Additional query words: 5.00 7.00 8.00 XL97 crash hang freeze lock-up

Keywords          : kbprg kbdta PgmOthr KbVBA 
Version           : MACINTOSH:5.0,5.0a; WINDOWS:5.0,5.0c,7.0
Platform          : MACINTOSH WINDOWS
Issue type        : kbbug
Solution Type     : kbpending

Last Reviewed: May 27, 1999