ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Close Workbook without displaying message to Save (https://www.excelbanter.com/excel-programming/301055-close-workbook-without-displaying-message-save.html)

Vinay[_2_]

Close Workbook without displaying message to Save
 
Hello:
I have a User form with a button labelled "CLOSE" which closes the
form as well as Quits the application. How I can prevent the Excel
Message which ask whether the user wants to save the file?
I would like to close the file without saving

TIA

Frank Kabel

Close Workbook without displaying message to Save
 
Hi
try
application.displayalerts=false
activeworkbook.close
application.displayalerts=True

--
Regards
Frank Kabel
Frankfurt, Germany


Vinay wrote:
Hello:
I have a User form with a button labelled "CLOSE" which closes the
form as well as Quits the application. How I can prevent the Excel
Message which ask whether the user wants to save the file?
I would like to close the file without saving

TIA


Tom Ogilvy

Close Workbook without displaying message to Save
 
Workbooks("MyFile.xls").Saved = True

--
Regards,
Tom Ogilvy

"Vinay" wrote in message
om...
Hello:
I have a User form with a button labelled "CLOSE" which closes the
form as well as Quits the application. How I can prevent the Excel
Message which ask whether the user wants to save the file?
I would like to close the file without saving

TIA





All times are GMT +1. The time now is 06:56 AM.

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