Excel: Avoiding "Save Changes" Dialog when Closing Document

Last reviewed: November 2, 1994
Article ID: Q31700

SUMMARY

To close a document through a macro and have Excel automatically save the document (without bringing up the dialog box: "Do you want to save changes?"), do the following:

   =CLOSE(TRUE)

To close a document through a macro and not save any changes made, use

   =CLOSE(FALSE)

MORE INFORMATION

In Excel versions 1.00-1.06, there is no parameter for the CLOSE function. To close a document through a macro and have it save automatically in these versions, use the following:

   =SAVE()
   =CLOSE()

To close a document and not save the changes through a macro in versions 1.00-1.06, use:

   =ERROR(FALSE)
   =CLOSE()
   =ERROR(TRUE)


KBCategory: kbother
KBSubcategory:

Additional reference words: 1.00 1.03 1.04 1.06 1.50 2.20 3.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 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.