ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   closing a spreadsheet (https://www.excelbanter.com/excel-programming/335670-closing-spreadsheet.html)

Cyberwolf

closing a spreadsheet
 
Is there a way to close a spreadsheet via a macro without it prompting to be
saved?

I have a macro that pulls in a text file, formats it and then saves the file
as a delimited text file. When I go to close the file it asks if I want to
save the changes, even though I have not made any since the macro ran and
saved it.

Tom Ogilvy

closing a spreadsheet
 
ActiveWorkbook.Close SaveChanges:=False

will do that.

--
Regards,
Tom Ogilvy

"Cyberwolf" wrote in message
...
Is there a way to close a spreadsheet via a macro without it prompting to

be
saved?

I have a macro that pulls in a text file, formats it and then saves the

file
as a delimited text file. When I go to close the file it asks if I want

to
save the changes, even though I have not made any since the macro ran and
saved it.





All times are GMT +1. The time now is 09:18 PM.

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