ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   auto_close addin (https://www.excelbanter.com/excel-programming/367847-auto_close-addin.html)

drew_p

auto_close addin
 
I have addin which unload on "auto_close". but i noticed that if user has
modified the Excel sheet and try to quite excel, Excel is showing dialog to
confirm to save changes. If user click "Cancel" for it ,still auto_close is
invoking.

So what is best way to verify user have clicked "Cancel" button and
don't unload the add-in


Peter T

auto_close addin
 
I don't think it's possible to prevent the close event firing before the
cancel close dialog appears. However the addin should still remain open at
this stage.

In the close event you could call another routine with the OnTime method. In
this you could perhaps reinstate whatever was done in the close event, eg
re-create menu items. Or if you maintain a global AppRunning type flag
change it in the close event, later any routine that needs things in place
can check it and do as necessary.

Regards,
Peter T


"drew_p" wrote in message
...
I have addin which unload on "auto_close". but i noticed that if user has
modified the Excel sheet and try to quite excel, Excel is showing dialog

to
confirm to save changes. If user click "Cancel" for it ,still auto_close

is
invoking.

So what is best way to verify user have clicked "Cancel" button and
don't unload the add-in





All times are GMT +1. The time now is 05:15 AM.

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