Addin not loading when excel is invoked programatically

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

Addin not loading when excel is invoked programatically
 
nitin c




Posts: 79
Joined: 2007-05-18
Hi,

Using my addin, I am trying to invoke a new excel instance, It invokes excel, but the addin is not loaded, however the UDF and COM addin are shown as checked in the menu.

Excel.Application excelApp;
excelApp = new ApplicationClass();
Excel.Workbook workBook = excelApp.Workbooks.Open(@"Templates.xlt", 0, false, 5, "", "",false, Excel.XlPlatform.xlWindows, "", true, false, 0, true);


Posted 12 Jun, 2007 10:47:58 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nitin.

I don't quite understand the goal of the code above if you use it from a COM add-in loaded in Excel.
By the way, to access the active instance of Excel you can use the Marshal.GetActiveObject method.


P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 12 Jun, 2007 12:23:29 Top
nitin c




Posts: 79
Joined: 2007-05-18
Hi Sergey,

The goal is that once my addin is loaded, user might select few options which will cause a new excel instance to open and I will create a xls at runtime and show it to user.

Also I tried using the Add method instead of Open, and it does load the addin, i can see my class when i click on "fx", will verify and post if it works.

Thanks for telling about Marshal.GetActiveObject, will use it if I need it.

Thanks,
Nitin
Posted 12 Jun, 2007 15:49:35 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Nitin,
I would advise you to use the current instance of Excel and just open a new workbook for the user using the Add or Open methods.
Posted 13 Jun, 2007 07:54:35 Top