Excel VisualBasic Script

Private Sub Workbook_BeforeClose(Cancel As Boolean)
           ThisWorkbook.Saved = True
     End Sub