ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unable to save workbook within WorkbookBeforeClose (https://www.excelbanter.com/excel-programming/283216-unable-save-workbook-within-workbookbeforeclose.html)

TTN[_3_]

Unable to save workbook within WorkbookBeforeClose
 

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

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


Lawlera

Unable to save workbook within WorkbookBeforeClose
 
Application.ScreenUpdating = Fals
Application.DisplayAlerts = Fals
ActiveWorkbook.Sav
Application.DisplayAlerts = True

Lawlera

Unable to save workbook within WorkbookBeforeClose
 
.... an be sure your macros are enabled!


All times are GMT +1. The time now is 06:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com