I am trying to Save the workbook without the alert.
My macro is below
Private Sub Workbook_BeforeClose(Cancel As Boolean) On Error Resume Next ThisWorkbook.Save 'SendKeys "Y" ThisWorkbook.Unprotect "XXX" Sheet3.Visible = xlSheetVisible Sheet3.Protect "XXX" Sheet1.Unprotect "XXX" Sheet2.Unprotect "XXX" Sheet1.Visible = xlSheetVeryHidden Sheet2.Visible = xlSheetVeryHidden ThisWorkbook.Protect "XXX" End Sub
this is my code and i have few codes in the Workbook_BeforeSave to make some changes.
Now after this i get a message "Do you want to save the Workbook."
Is there a way i can get rid of this message and save the workbook automatically.