Home » excel » excel – Calling other xll files from C#/ExcelDNA code

excel – Calling other xll files from C#/ExcelDNA code

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have some ExcelDNA C# code which I am working on, and within Excel an xll plugin that I’d like to be able to access. I am not able to get the source code of this plugin – it has to be used as is. So is there a method of being able to access these functions from C#?

How to&Answers:

Great to see an ExcelDna tag on StackOverflow!

You should take a look at making a call to xlUDF. It should allow you make a call to any UDF (including that of your XLL so long as it’s loaded).

The MSDN description is here, with a similar question answered on Google Groups.

I hope this helps – please let me know how you get on as I would like to add xlUDF to my list of ExcelDna examples.

Chris

Answer:

You can use GET.PROCEDURES from http://xllutility.codeplex.com to get a list of all loaded add-ins and their C signature from the third column of the array this returns.

This is a more general answer on how to call functions in any xll from any language that can call C. If you are using ExcelDna then the xlUDF route is much simpler.