G
Guest
I am new to C# and have been trying to figure out how to access a range
passed to C#. I have tried everything I can find and have been unable to get
it to work. Here is a test sample Ive been playing with and It returns an
error. What is wrong with this function?
public int CalcArray(ref int CalcType,ref int Lines,Excel.Range rngFind)
{
double test;
int result;
result = Convert.ToInt32(rngFind.get_Offset(0, 1).Value2);
return result;
}
In excel, I have a cell that "=CalcArray(H4,J7,A3:A5)" to call it. Cell H4,
J7 are numbers. Same with Column A. When the function is called it gets a
#Value error.
passed to C#. I have tried everything I can find and have been unable to get
it to work. Here is a test sample Ive been playing with and It returns an
error. What is wrong with this function?
public int CalcArray(ref int CalcType,ref int Lines,Excel.Range rngFind)
{
double test;
int result;
result = Convert.ToInt32(rngFind.get_Offset(0, 1).Value2);
return result;
}
In excel, I have a cell that "=CalcArray(H4,J7,A3:A5)" to call it. Cell H4,
J7 are numbers. Same with Column A. When the function is called it gets a
#Value error.