I am trying to get familiar with Excel-DNA but cannot find documentation on how I could loop through a selected range of values in worksheet cells. So, I would have a user defined function which would take as parameters a range of cells where I would have some data. Then I would loop trough this range of cells and do something with the data. How can I do this kind of basic operation? My code in Visual Studio could look something like this.
using System;
using System.Collections.Generic;
using ExcelDna.Integration;
namespace myUDF
{
public static class Class1
{
[ExcelFunction(Name = "LoopArrayTester")]
public static List<double> LoopArrayTester(??? range)
{
List<double> list = new List<double>();
// loop through somehow the range in worksheet given
// somehow in the method signature
for(int i = 0; i < range.count; i++)
{
// get values of i'th cell in range and put it to list
// or something.
}
}
return list;
}
}