Knowledge Base

XL98: Type 2 Error Message Saving a Workbook or Add-In

Article ID: 184367

Article Last Modified on 9/11/2002


APPLIES TO


This article was previously published under Q184367

SYMPTOMS

In Microsoft Excel 98, when you save a workbook, you receive the following error message:
The application "Microsoft Excel" has unexpectedly quit, because an error of type 2 occurred.

You should save your work in other open applications and restart the computer.

CAUSE

This problem occurs under the following circumstances:

  • You type code in the BeforeSave event for the workbook. -and-

  • You set the IsAddin property for the workbook to True.

WORKAROUND

To work around this problem, remove the code in the BeforeSave event for the workbook. To do this, follow these steps:

  1. On the File menu, click Open to open the workbook (or add-in).
  2. Press OPTION+F11 to view the Visual Basic Editor.
  3. On the View menu, click Project Explorer.
  4. Select the ThisWorkbook object for the workbook, and then click Code on the View menu.
  5. In the Code window, click Workbook in the Object list and click BeforeSave in the Procedure list.
  6. Delete the code in the Workbook_BeforeSave event procedure.
  7. Save the workbook.

STATUS

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

Additional query words: XL98 ipf gpf addin

Keywords: kbbug kbprogramming kbpending KB184367