I have an Excel interop module A (that display on the menu bar) which in turn load another Excel add-in B.xla when Excel is loaded.
A is installed into Excel by an msi installer. B.xla is charged via
AddIn addin = excelApp.AddIns.Add(xlaFile); if (!addin.Installed) addin.Installed = true;
When I uninstall A, the file B.xla that was brought by the installer is deleted. A is also deleted from the menu bar and from the list of COM add-ins. However, B is not deleted from the list of macro add-ins.
Therefore, after uninstalling A, when I open Excel the first time, a message will show saying "Add-in B is missing". I need to go to macro add-ins manager to uncheck B. Upon clicking to uncheck, Excel will say again that it cannot find B, and delete it from the list.
How can I deactivate and delete B from the list upon uninstalling A programmatically, without passing through the Add-ins dialog/manager? This is posing a problem when I perform an update of A. A is deleted from the menu bar, B.xla (the file itself) is deleted together with A, but the entry of B in Add-ins dialog is still there, and will block the update trying to register a new B into the add-ins dialog.