excelvstoexcel-dnaxll

Excel AddIn installed and uninstall event


I am trying to load excel xll addin in Excel VSTO.

I used Globals.ThisAddIn.Application.AddIns.Add and .Installed to install and uninstall xll

            AddIn intelliSenseAddIn = default;
            if (intelliSenseAddInOption.Checked)
            {
                intelliSenseAddIn = Globals.ThisAddIn.Application.AddIns.Add(@"xx.xll");
                intelliSenseAddIn.Installed = true;
            }
            else
            {
                intelliSenseAddIn.Installed = false;
            }

But, user can uncheck the addin from built-in tab, I am wondering whether there is any event will fire when user uncheck or check the item in Excel Addins windows

enter image description here


Solution

  • I don't think there's an event in the COM object model for this, but when the user uninstalls the .xll add-in, the IExcelAddIn.AutoClose in the Excel-DNA add-in will be called.