Workbook_BeforeClose not working when closing application

rdwray

New member
Joined
Mar 25, 2017
Messages
38
Reaction score
0
Points
0
Excel Version(s)
2010
In Excel 2010 if I use the close workbook "X", Workbook_BeforeClose works, but if I use the application close button, it does not - why?
 
Last edited:
In Excel 2010 if I use the close workbook "X", Workbook_BeforeClose works, but if I use the application close button, it does not - why?

Rdwray,

I don't quite understand your question. When you say you are using the application close button, do you mean your code is similar to the following:

Code:
Application.ThisWorkbook.Close
?
 
Rdwray,

I don't quite understand your question. When you say you are using the application close button, do you mean your code is similar to the following:

Code:
Application.ThisWorkbook.Close
?

Maybe I misstated it. There are 2 "X"s, one will close the work book and the other will close the application (Excel). Another thing I did not state is that I am working with Personal.xlsb. I have since found out that it is impossible to do, as soon as you share the workbook, it locks out Workbook_BeforeClose and having Personal.xlsb not shared is useless.
 
Back
Top