Microsoft KB Archive/67473

{|
 * width="100%"|

Excel: Using HALT to Stop an Auto_Close Macro in 3.00

 * }

-

The information in this article applies to:


 * Microsoft Excel for the Macintosh, versions 3.0, 4.0

-

SUMMARY
If it is necessary to stop an Auto_Close macro (while debugging a macro or after a question dialog box), using the function HALT(TRUE) will stop the macro and prevent the macro sheet from closing.

NOTE: Halting an Auto_Close macro requires Excel 3.00 or later. Using Auto_Close in earlier versions of Excel can cause unpredictable results or loss of data.

MORE INFORMATION
The structure for the HALT function is as follows:

  HALT(cancel_close)

&quot;Cancel_close&quot; is a logical value that specifies whether the macro sheet, when encountering the HALT function in an Auto_Close macro, is closed.

If &quot;cancel_close&quot; is TRUE, Excel halts the macro and prevents the document from closing. If &quot;cancel_close&quot; is FALSE or omitted, Excel halts the macro and closes the document.