View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NA_AB[_2_] NA_AB[_2_] is offline
external usenet poster
 
Posts: 57
Default a problem with variable number of parameters.

hey all, this seems to be working fine,

int Method(params int[] numbers)
{
int count = 0;
foreach (int n in numbers)
{
count++;
}
return count;
}

but,


when am trying to build a com addin to excel, and am trying to invoke this
function using the excel formula way i.e., as =Method(10,20,30) or
=Method(1,2,3,4,5,6) and so on... I'm always getting a '#VALUE!'

WHAT COULD BE THE PROBLEM?! thanks in advance people... any help shall be
considered very thankful.. :)