Question : Excel automation: unload XLL so Excel can quit

Folks,

I'm automating Excel in .net.  The OM has an Application.RegisterXLL method, which I call to register my XLLs.  However, once registered, I can't figure out how to unregister them.  Application.Quit won't work unless the XLLs are unregistered

I'm well aware about Marhsal.FinalReleaseComObject for the excel objects I use in the lifetime of the app.  This issue is particular to XLLs, I've isolated it.

How do I unload or unregister an XLL?

note that this doesn't work:
Application.ExecuteExcel4Macro( "UNREGISTER("myxllfile.xll)");

Answer : Excel automation: unload XLL so Excel can quit

Hi,

Some clarifications about my previously post:
1) No, it does not require a new workbook to be added, I only used it in the sample so something else was executed. Programmatically we can do it but when activate an add-in manually a workbook must be open.

2) In general we need to understand that add-ins must be both registered and activated in Excel before they are available.

One call to the Addins installed is only required per Excel process. This approach is the standard approach to activate already registered add-ins. The only scenario in which this approach will fail is if the add-in is not registered. If the add-in is already activated then a call to the Addins installed will have no impact at all.

The RegisterXLL approach both register and activate add-ins. Re-register an already registered add-in is an unnecessary activity. But if we don't know the status (registered or not) then I find it to be a workable approach.

Could You have the kindness to explain the following to me:
"I know the filepath to the most up-to-date add-in, so I want to Add that and then Install it.  How do I reconcile that against what's already in Excel via the UI?"

I can agree on how You use the constructor.

Kind regards,
Dennis
Random Solutions  
 
programming4us programming4us