Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

I have installed an Excel AddIn (automation excel AddIn - mscoree.dll)
This AddIn has an Function called MyFunction.
When i start Excel.exe the AddIn will be loaded (LoadBehavior = 3, OPEN = /A "MyAddIn")
I can see and use MyFunction, but when i use the Microsoft.Office.Interop.Excel i don't have the Function.
The ExcelAddInManager show me that the AddIn is loaded and
C#
m_ExcelApp.AddIns(MyAddIn).Installed = true [mscoree.dll]

What i what do to:
C#
((Excel.Application)m_ExcelApp).Evaluate("=MyFunction()");

What is my Question:
What i have to do to use the Function in MyAddin when i use the Interop of Excel?
Posted
Updated 17-Jan-12 22:41pm
v2

1 solution

after 3 days debugin and afert poste my problem i have the solution :-)

m_ExcelApp.AddIns(mscorre.dll) says, that the AddIn (Automation AddIn) is installed.
But this is wrong.

You have to set the property to false.
Then Register the .dll again and set the property to true.



foreach (Excel.AddIn a in m_ExcelApp.AddIns)
{
if (a.Name.StartsWith("mscoree")) //Test - Temp
{
a.Installed = false;
m_ExcelApp.RegisterXLL(a.FullName);
a.Installed = true;
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900