auto_close addin

G

Guest

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
 
P

Peter T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top