Hello,
workbook_beforeclose event fires when the user press the Close button but if there are any changes it will ask him to save and he could press Cancel
The question is how I could make this event runs only when the user close the file completely or how I could know if he pressed Cancel.
Thanks.
## EDIT ##
After I searched the Internet, I found one approach by duplicate the save msg by new one, that know whether the user chosen Cancel or not, you could see it here
http://spreadsheetpage.com/index.php/tip/handling_the_workbook_beforeclose_event/
I will not make the question answered so I could receive another answers (if possible)
## 2nd EDIT ##
There is another way -it is what I'm using right now- by put the second code that should be fired when you click Cancel in an Worksheet_deactivate event so you could know if the file is open when the user change the sheets
(This helped me because I have a specific sheet is selected when you close the file and this sheet is unusable)
OR you could put that could in change event or a button
####
I found a solutin for my question but I'm trying to help anyone read this thread later.
I will post an answer to this question if there are no any other answers, and I will put these tries in it.