How to I unload the addin?

Add-in Express™ Support Service
That's what is more important than anything else

How to I unload the addin?
 
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
Posted 05 May, 2005 18:12:54 Top
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
Posted 06 May, 2005 06:07:25 Top