Unable to save workbook within WorkbookBeforeClose

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
 
G

Guest

Application.ScreenUpdating = Fals
Application.DisplayAlerts = Fals
ActiveWorkbook.Sav
Application.DisplayAlerts = True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top