1
범위 (이 시점에서 1d)를 내 함수에 전달하고 범위의 수식을 포함하는 문자열 배열을 반환하고자합니다.ExcelDNA를 사용하는 범위에서 Excel 수식을 어떻게 구합니까?
여기 내 (작동하지 않는) 코드는 지금까지의 :
public static object[,] ReadFormulas([ExcelArgument(AllowReference=true)]object arg)
{
ExcelReference theRef = (ExcelReference)arg;
object[,] o = (object[,])theRef.GetValue();
string[,] res = new string[o.GetLength(1),1];
for(int i=0;i<o.GetLength(1);i++)
{
ExcelReference cellRef = new ExcelReference(theRef.RowFirst+i, theRef.ColumnFirst);
res[i,0] = XlCall.Excel(XlCall.xlfGetFormula, cellRef) as string; //Errors here
}
return res;
}