ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Systematically Close File, Without Saving Changes (https://www.excelbanter.com/excel-programming/356507-systematically-close-file-without-saving-changes.html)

MWS

Systematically Close File, Without Saving Changes
 
Hello, I have an excel program and want to give the user a method to simply
stop using the file, and close it without "saving" any of the data. Can
anyone tell me what code to use?

Thanks in advance

Tom Ogilvy

Systematically Close File, Without Saving Changes
 
ActiveWorkbook.Close SaveChanges:=False

--
Regards,
Tom Ogilvy


"MWS" wrote:

Hello, I have an excel program and want to give the user a method to simply
stop using the file, and close it without "saving" any of the data. Can
anyone tell me what code to use?

Thanks in advance


David C

Systematically Close File, Without Saving Changes
 
I found this works for me - I wanted to close Excel without saving any (all
files were read-only anyway), but that annoying message kept popping up.

First, in the 'QUIT' subroutine, I put ActiveWorkbook.Close
SaveChanges:=False [that stopped the messages] and then in the 'Before Close'
event I put Application.Quit

Works a treat, and faster too.

"Tom Ogilvy" wrote:

ActiveWorkbook.Close SaveChanges:=False

--
Regards,
Tom Ogilvy


"MWS" wrote:

Hello, I have an excel program and want to give the user a method to simply
stop using the file, and close it without "saving" any of the data. Can
anyone tell me what code to use?

Thanks in advance



All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com