turn off 'do you want to save' message

Hi, I am new to vba and at this point I am mostly just altering prewritten scripts from the internet, so please pardon my bad terminolgies. I have a project that has probably a dozen different macros running and everything is all running just fine.
One of my macros does a 'save as' on the current workbook, then opens the master workbook and closes all workbooks except the master workbook. The only issue I have is that when it closes the workbooks I get the 'do you want to save' message. The code has already done all the saves that I need and I do not want the user to have to deal with answering the pop-up everytime.
Can someone tell me the code to add so that when my macro closes the workbooks it will just close them without asking if I want to save changes?
Thanks for any help there may be.

Nick's picture


You can tell Excel the the workbook has already been saved (even if it it hasn't)
to do this use:

Thisworkbook.Saved = TRUE
- then when you close, it doesn't ask to save changes

Vishesh's picture

As you said that code had

As you said that code had already done all the saves, so to avoid that message to save you can write

workbook.close False

The parameter False ensures that the file is closed without saving.