MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Close File and Skip save changes window

Posted by Kelvin on February 14, 2002 2:30 PM

Is there a way to write a Macro that ignores or skips the window that asks to save the changes in a file when closing it?

Posted by DRJ on February 14, 2002 5:59 PM


Put this line in the thisworkbook code

Sub Workbook_BeforeClose
thisworkbook.saved = true
end sub

This will make excel think it is saved before it closes the the message asking to save will not pop up.