ERLANDSEN DATA CONSULTING Excel & VBA Tips   Informasjon på norsk / Information in Norwegian

These pages are no longer updated and are only available for archive purposes.

Click here to visit the pages with updated information.

Close a workbook

If you just want to close a workbook without the user being prompted for any confirmations about saving the workbook you can simply do this :

ActiveWorkbook.Close False 
' closes the active workbook without saving any changes

ActiveWorkbook.Close True 
' closes the active workbook and saves any changes

ActiveWorkbook.Close 
' closes the active workbook and lets the user decide if 
' changes are to be saved or not

 

Document last updated 1999-12-20 12:51:17      Printerfriendly version

User comments:
Ole P. from Norway wrote (2006-01-04 10:47:10 CET):
Re: command
Take a look at the example "Prevent the user from stopping a running macro"
sunil landge from vadodara, India wrote (2006-01-04 08:54:39 CET):
command
how to use application.enablecancelkey in macro?
Nicholas from Colombia wrote (2005-02-23 15:05:03 CET):
Thanks
It's very nice. I had a lot of problems with close a workbook

 

Erlandsen Data Consulting     http://www.erlandsendata.no/   
Excel & VBA Tips   Copyright ©1999-2024    Ole P. Erlandsen   All rights reserved
E-mail Contact Address