Variable number of parameters in Excel User Defined Function

E

ep

Hey All,

I'm writing a C# automation add-in for Excel 2003 and I need to be able to
pass in an undefined number of object parameters (ie noncontiguous cells) to
my UDF. This is achieved in VBA by using the ParamArray, but the C# params
doesn't seem to work.

Does anyone know a way I can do this without hardcoding in "optional"
parameters? Let me know if there's anything else that would be helpful to
know.

Thanks
 
T

Tony Gravagno

Try this method signature:
Object MyFunc(params Object[][,] YourCells)

You may find other useful info on this topic in my blog. If you get a
successful deployment, please let me know.



Tony Gravagno
Nebula Research and Development
remove.mungeNebula-RnD.com/blog/tech/2007/11/excel-tools5.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top