tags:

views:

146

answers:

1

I have a XLL Addin (Test.xll). I wish to use this in my C# (VS2008/.Net 3.5) application. If anybody can guide me how to use this in my C# application.

If anybody could please guide me how to use this XLL in the C# application, it will be great.

Any help is appreciated.

Regards, Tushar

A: 

You'll have to use P/Invoke via static external methods which use the DLL's exports. However, depending on the dependencies in the XLL (especially if it uses some Excel functionality) you may not be able to get this to work properly.

Lucero
@Lucero: Thanks for sharing. However i am not clear, if i need to reference the XLL (if yes, how can i do that, as i can only refererence DLL/EXE/TLB/OCX etc, not a XLL).
tush1r
The XLL is in fact just a normal unmanaged (!) DLL, you can rename it to DLL. But you don't reference it directly, instead, you declare the functions to be imported via DllImportAttribute: http://msdn.microsoft.com/de-de/library/system.runtime.interopservices.dllimportattribute(VS.80).aspx
Lucero