Hello,
I’m using a custom calc engine to find all of the CHOOSE formulas in a particular workbook. The Calculate override method is only being called for 2 of the 14 instances of the formula in the workbook. I’m having a heard time figuring out why it’s not being called for the other formulas.
ChooseExample.zip (7.6 KB)
This is my test code and the example file is attached.
static void Main(string[] args)
{
var filename = @"ChooseExample.xlsx";
using var fileStream = File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
var workbook = new Workbook(fileStream);
workbook.CalculateFormula(new CalculationOptions
{
IgnoreError = false,
CustomEngine = new MyCustomEngine()
});
Console.In.ReadLine();
}
internal class MyCustomEngine : AbstractCalculationEngine
{
public override bool ProcessBuiltInFunctions { get; } = true;
public override void Calculate(CalculationData data)
{
Console.Out.WriteLine($"{data.Cell.Name}{data.Cell.Formula}");
}
}
The output from this example displays:
A1=CHOOSE(2,"202000000001","USA")
A3=CHOOSE(2,"202000000002","EMEA")
A16=MADEUPFORMULA("test")
Where’s the formulas in cells A2 and A4 through A14?
Thanks,
-Andy