Microsoft KB Archive/79139

{| = Excel: CLOSE.ALL in an Auto_Close Macro Generates Error =
 * width="100%"|

Last reviewed: November 30, 1994

Article ID: Q79139 The information in this article applies to:
 * Microsoft Excel for Windows, version 3.0
 * Microsoft Excel for OS/2, version 3.0

SUMMARY
Attempting to close Microsoft Excel from the application Control menu (-) with a worksheet open that contains an Auto_Close macro may result in a macro error. The error occurs if the Auto_Close macro executes a CLOSE.ALL command. The error also occurs if the Auto_Close macro executes a QUIT command.

MORE INFORMATION
The same error occurs if you attempt to close Microsoft Excel using the File Exit command, or if you attempt to close all worksheets by choosing Close All from the File menu.

Workaround
Close the worksheet by choosing Close from the File Menu or from the worksheet's Control menu (-). This will envoke the Auto_Close macro and the CLOSE.ALL or QUIT command will execute correctly.