Unable to save workbook within WorkbookBeforeClose

  • Thread starter Thread starter TTN
  • Start date Start date
T

TTN

Hi,

I'm trying to save the current workbook within the WorkbookBeforeClose
but the file is not saving.

The WorkbookBeforeClose is an application level event in my com addi
with the following signatur

Private Sub mExcel_WorkbookBeforeClose(ByVal Wb As Excel.Workbook
Cancel As Boolean)

If Not Wb.saved Then
Wb.Save
Wb.saved =True
End If

End Sub

Calling the Wb.Save should save the workbook, but it didn't.

Am I doing something wrong here
 
Application.ScreenUpdating = Fals
Application.DisplayAlerts = Fals
ActiveWorkbook.Sav
Application.DisplayAlerts = True
 
Back
Top