unable to save current workbook within WorkbookBeforeClose

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

TTN

I am trying to save the current workbook within
WorkbookBeforeClose, but the workbook is not saving.


Is this a bug?
And how do I workaround this
 
Try this

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Save
End Sub
 
The WorkbookBeforeClose is an application level event in my com addi
with the following signatur

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

Wb.Save

End Sub



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