the application asks if you want to save if there have been any changes.
WB.Close False
is the easiest way to overcome this - where wb is the workbook obkect set to
the workbook we're dealing with.
Also , we could clear the dirty flag which tells excel whether the sheets
have changed or not in the ThisWorkbook's before close event. A value of
False would trigger the application alert to save.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub