Reputation: 557
I'm launching Excel from code using this code :
var excelApp = new MSExcel.Application { Visible = true };
excelApp.Workbooks.Add();
excelApp = null;
I've added the second line because without it the Excel automatically closes when the launcher closes. When I add new workbook it keeps alive. Howewer, my add-in that has nothing to do with the launcher won;t load. Any suggestions ?
Thanks for your advice.
Upvotes: 1
Views: 566
Reputation: 2748
idealy mustnot happen, but a workaround you may try
foreach (COMAddIn addin in application.COMAddIns)
{
if (addin.Description.ToLower().Equals(addinName.ToLower()) || string.Equals(addin.Description, "[AddInName]", StringComparison.OrdinalIgnoreCase))
{
addIn.Connect = true;
break;
}
}
Upvotes: 1