Excel: Using HALT to Stop an Auto_Close Macro in 3.00

Last reviewed: November 29, 1994
Article ID: Q67473
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)

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

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

REFERENCES

For more information on the HALT function, see page 217 of the "Microsoft Excel Function Reference" version 4.0 manual or page 120 of the "Microsoft Excel Function Reference" version 3.0 manual.


KBCategory: kbusage
KBSubcategory:

Additional reference words: 3.00 4.00


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