ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook_BeforeClose (https://www.excelbanter.com/excel-programming/358566-workbook_beforeclose.html)

[email protected]

Workbook_BeforeClose
 
I have some 'DeleteMenus' macros in the 'Workbook_BeforeClose'
procedure which works fine.

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Run "DeleteModelsOptions"
Run "DeleteCostMenu"
Run "DeleteSpecListMenu"

ActiveWorkbook.Close savechanges:=False

End Sub


The problem I have is if a new workbook is opened as well and then
closed, it seems to run the 'DeleteMenus' macros of the other workbook,
therefore removing the menu's.

Don't understand why this is happening as the 'new'
workbook_beforeclose procedure is empty.

Help


arno

Workbook_BeforeClose
 
Hi paul,

maybe this is your problem:
ActiveWorkbook.Close savechanges:=False


THISworkbook.close

arno


All times are GMT +1. The time now is 07:55 PM.

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