Dear Aspose Team,
I am using
Aspose.Cells 25.11.0.
.NET 9.0
We have Spill Function includes LET with XLOOKUP and run RefreshDynamicArrayFormulas and CalculateFormula
Spill function does not update correctly.
If I start editing and press Enter, Spill function will be recalculated and everything will work correctly.
In this example, we see #CALC. BUT the main issue is that Spill Function is not recalculated and shows result before calculation (i.e., Spill Function is based on data from tables and if data has changed, Spill Function shows previous old spill data result)
Code:
var input = @"C:\input-for-aspose.xlsx";
var output = @"C:\output.xlsx";
Workbook? wbc;
using (var ms = new FileStream(input, FileMode.Open))
wbc = new Workbook(ms, new LoadOptions(LoadFormat.Xlsx));
var engine = new CustomCalculationEngine {};
var opts = new CalculationOptions { CustomEngine = engine };
wbc.RefreshDynamicArrayFormulas(true, opts);
wbc.CalculateFormula(opts);
wbc.Save(output);
public class CustomCalculationEngine : AbstractCalculationEngine
{
public override void Calculate(CalculationData data)
{
}
}
input-for-aspose.zip (14.6 KB)
output.zip (15.0 KB)
@aleksandr.l
The behavior you describe matches a known limitation when a custom calculation engine is supplied. The engine is invoked for every formula, and if it does not handle the dynamic‑array functions (LET, XLOOKUP, FILTER, etc.) the default implementation is bypassed, so the spill range is not refreshed.
What to try
-
Run the workbook without a custom engine – set CustomEngine = null (or omit the property) and call the methods in the order recommended in the forum:
var wb = new Workbook(input);
var opts = new CalculationOptions { Recursive = true }; // optional but useful
wb.RefreshDynamicArrayFormulas(true, opts);
wb.CalculateFormula(opts);
wb.Save(output);
If the spill formulas update correctly, the issue is caused by the custom engine.
-
If you need the custom engine, implement the missing functions or delegate to the base implementation for formulas you do not handle:
public override void Calculate(CalculationData data)
{
// Let the default engine process unknown functions
if (!HandleMyCustomFunction(data))
base.Calculate(data);
}
(The AbstractCalculationEngine provides a base.Calculate that falls back to the built‑in evaluator.)
-
Test with the latest Aspose.Cells build (e.g., 25.12.x). Occasionally bugs are fixed in newer releases, and the latest version includes several improvements to dynamic‑array handling.
What we need to confirm
- The exact version you are using (full build number).
- Whether the workbook contains any other user‑defined functions besides the empty
CustomCalculationEngine.
- If the issue persists after step 1 (no custom engine) on the latest build.
Please run the above test and let us know the result, together with the build number and any error messages you see. With that information we can reproduce the scenario and, if it is a defect, log it for a fix.
@aleksandr.l,
Thanks for the template Excel file and sample code snippet.
I reproduced the issue as you mentioned by using your template Excel file and sample code snippet. I found Spill function is not updating.
We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-59536
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.