0

Context: Windows 7, Office 2007, ExcelDNA 0.30

Given that ExcelDNA doesn't support ParamArray, I had an outlandish idea: can Reflection help?

After a bit of fiddling with .NET and Reflection I can see that it's good at getting static info about an Assembly, even down to the the names and data types of methods. However (and I don't know where to go to find this out) can it tell me stuff about a system as it is running?

For instance, can I know how many arguments were actually supplied to a method that has 30 parameters (named p1 through p30) or do I have to do a long select case checking each (as I do now without Reflection)? Can I access the arguments iteratively, from 1 to the number of "occupied" parameters?

And on a related issue: I can pass two arguments to a method defined with three parameters, but I can't pass three arguments to a method defined with two. Is there a way of defining a method to receive any number of parameters, but without using ParamArray (remember, we're using ExcelDNA here, which doesn't support ParamArray)?

bugmagnet
  • 7,631
  • 8
  • 69
  • 131

0 Answers0