ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Personal.xls & Workbook_BeforeClose (https://www.excelbanter.com/excel-programming/329406-personal-xls-workbook_beforeclose.html)

William[_2_]

Personal.xls & Workbook_BeforeClose
 
Hi

Can anyone explain why the "Workbook_BeforeClose" event does not work with
the "Personal.xls" file.

The code below is in the "ThisWorkBook" module of the Personal.xls file.

'This works fine
Private Sub Workbook_Open()
MsgBox "Opening"
End Sub

'This does not work
Private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox "Closing"
End Sub
'(This does work however if Personal.xls is not closed at the same time as
the Excel application.)



Thanks
--

XL2003
Regards

William







Tom Ogilvy

Personal.xls & Workbook_BeforeClose
 
It works fine for me.

Are you sure you saved personal.xls after making the change and before you
tried to close it?

--
Regards,
Tom Ogilvy


"William" wrote in message
...
Hi

Can anyone explain why the "Workbook_BeforeClose" event does not work with
the "Personal.xls" file.

The code below is in the "ThisWorkBook" module of the Personal.xls file.

'This works fine
Private Sub Workbook_Open()
MsgBox "Opening"
End Sub

'This does not work
Private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox "Closing"
End Sub
'(This does work however if Personal.xls is not closed at the same time as
the Excel application.)



Thanks
--

XL2003
Regards

William









William[_2_]

Personal.xls & Workbook_BeforeClose
 
Thanks for replying Tom.

"...Are you sure you saved personal.xls after making the change and before
you tried to close it?..."
Yes, retested on 2 computers, one with XL2002 and one with XL2003. I also
created a new "Personal.xls" file without any code other than the WorkBook
open and close messages. I also uninstalled all addins.

I think the problem lies with the Acrobat writer.....
--

XL2003
Regards

William



"Tom Ogilvy" wrote in message
...
It works fine for me.

Are you sure you saved personal.xls after making the change and before
you
tried to close it?

--
Regards,
Tom Ogilvy


"William" wrote in message
...
Hi

Can anyone explain why the "Workbook_BeforeClose" event does not work
with
the "Personal.xls" file.

The code below is in the "ThisWorkBook" module of the Personal.xls file.

'This works fine
Private Sub Workbook_Open()
MsgBox "Opening"
End Sub

'This does not work
Private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox "Closing"
End Sub
'(This does work however if Personal.xls is not closed at the same time
as
the Excel application.)



Thanks
--

XL2003
Regards

William












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

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