Unless I am missing something obvious, why does this program display #Recursive Reference! instead of 2:
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Aspose.Cells;
namespace TestAspose
{
class Program
{
static void Main(string[] args)
{
// Procedure1();
// Procedure2();
Procedure5();
Console.WriteLine(“Done!”);
Console.ReadKey();
}
private static void Procedure5()
{
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
//Get the cells collection in the sheet
Cells cells = worksheet.Cells;
cells[“A1”].SetArrayFormula("=myarrayfunc()", 1, 5);
workbook.CalculateFormula(false, new CustomFunction());
Console.WriteLine(cells[“B1”].Value);
}
}
public class CustomFunction : ICustomFunction
{
public object CalculateCustomFunction(string functionName, System.Collections.ArrayList paramsList, System.Collections.ArrayList contextObjects)
{
if (functionName.ToLower().Equals(“myarrayfunc”))
{
return new object[] {1, 2, 3, 4, 5};
}
return null;
}
}
}
Hi,
Thank for providing us sample code and details.
Thank you.
Thank you for looking into this, and also thank you for all the other answers.
Hi,
Please download and try the latest fix: Aspose.Cells for .NET v7.2.2.2.
And if you want to return array, please return object[][]. If the value is
number, please return double value not int value.
The fix works.
Thank you!
Hi,
Thanks for your feedback.
It’s good to know that your issue is resolved now. If you face any other problem, please feel free to post, we will help you asap.
The issues you have found earlier (filed as CELLSNET-40777) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.