Steve Weixel
Guest
|
I have an item on my menu to close my add-in. I'd like the addin to disconnect from the host and remove its menu. I couldn't find anything in the addinmodule that looked like it would do this. I tried using the COMAddinObj directly and calling COMAddinObj.Connect = False, which does work to disconnect the addin, but the menus are not removed, and the disconnection events (AddinBeginShutdown and AddinFinalize) are not called. I also tried changing the load behavior but that do anything as far as I could tell.
Update: If I dispose my commandbar then it *does* fire the aforementioned disconnection events, but still does not remove the menu. I also tried removing the menu manually and didn't work either.
Using 2.2 preview |
|
Sven Heitmann
Posts: 193
Joined: 2004-08-23
|
Hi Steve,
running this
Application.COMAddIns(ProgID).Connect = Not Application.COMAddIns(ProgID).Connect
is working fine for me, to switch the addins connection state.
However it's running from VBA. Running it from my Addin ended in the same results as yours.
So I think you can not shutdown the addin, from some code inside the addin itself.
Perhaps you should try a workaround with a dot-addin (if ther is no other idea from someone else)
Best regards,
Sven Heitmann |
|