Microsoft KB Archive/64207

QUIT is Macro Equivalent to File Exit Command PSS ID Number: Q64207 Article last modified on 07-01-1993 PSS database name: W_eXceL

2.x 3.00 4.00 | 2.20 2.21 3.00

WINDOWS | OS/2

Summary:

To exit Microsoft Excel with a macro, use the QUIT function. The QUIT function is the command equivalent to a File Exit. If any unsaved sheets are open, you will be prompted to save them.

More Information:

Another way to exit from Microsoft Excel is to use SEND.KEYS, as follows:

=SEND.KEYS(“%(f)x”)

or

=SEND.KEYS(“%{F4}”)

These procedures will completely quit Microsoft Excel as if you chose exit from the File menu. If you want to exit Microsoft Excel, and have Microsoft Excel close all files regardless of whether changes have been made or not, turn error checking off, as follows:

=ERROR(false) =QUIT =RETURN

Note: When using the STEP function, QUIT is ignored and you continue to step through the remainder of the macro.

Additional reference words: 2.0 2.00 2.01 2.1 2.10 2.2 2.20 2.21 3.0 3.00 4.0 4.00

Copyright Microsoft Corporation 1993.