By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,454 Members | 3,133 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,454 IT Pros & Developers. It's quick & easy.

save changes to excel document

P: 58

I have an excel document which is populated by a table,printed, and closed. I get the message "do you want to save the changes to "XXX.xls"?" I do not want to save the changes ever. Is there a way I can not get this message everytime i close the popuilated the document? I have tried (docmd.setwarnings false) thinking it may work, but it does not.

Dec 22 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 2,653
Hi, Anrew.

Put the following code to [ThisWorkbook] module.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  2.     ThisWorkbook.Saved = True
  3. End Sub
Dec 22 '07 #2

P: 58
Thank you very much, works awesome

Dec 22 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.