Hi,
In Aspose.Cells for .NET 26.4.0, Workbook.Save(path, new XlsbSaveOptions()) writes a 6-byte stub for xl/calcChain.bin regardless of how many formula cells the workbook contains. The same workbook saved as XLSX via new OoxmlSaveOptions(SaveFormat.Xlsx) writes a 151-byte stub for xl/calcChain.xml. In both cases the stub contains zero c entries, so when Excel opens the file it has to rebuild the entire calculation chain cold. On a real-world customer workbook (~52 MB, hundreds of sheets, hundreds of thousands of formula cells) this hangs Excel for 10–15 minutes on first open. After a manual Save-As in Excel, the same workbook opens in under a minute — the only difference is that Excel writes a proper, populated calcChain.
We have searched the public API surface (WorkbookSettings, WorkbookSettings.FormulaSettings, XlsbSaveOptions, OoxmlSaveOptions, LoadOptions) via reflection and tried every formula-related property we found. None of them change the output. We would like to know whether (a) there is an API we missed for emitting a real calc chain, or (b) this is a defect that needs a fix.
Minimal repro
Standalone .NET 9 console project, attached as AsposeXlsbCalcChainRepro.zip. Builds a workbook with 100,000 input rows × 4 formula columns (400,000 formula cells), calls CalculateFormula, saves as XLSB and XLSX, then inspects the resulting zip entries.
AsposeXlsbCalcChainRepro.zip (29.7 KB)
For comparison, the customer workbook that Excel re-saved locally contains an xl/calcChain.bin of 47,522,811 bytes — i.e. a real, fully populated calc chain. The Aspose-saved version of the same workbook is the 6-byte stub.
What we have ruled out
- Format does not matter: XLSB stub is 6 bytes, XLSX stub is 151 bytes. Both are empty in the sense that they contain no
centries. CalculateFormula()does not matter: skipping it produces the same stub.Workbook.Settings.FormulaSettings.EnableCalculationChain = truehas no effect on the saved file.Workbook.Settings.FormulaSettings.CalculateOnSave = true(the default) has no effect.Workbook.Settings.MaxRowsOfSharedFormula = int.MaxValuehas no effect.CalcModeType.AutomaticvsManualhas no effect.- The older
Workbook.Settings.CreateCalcChainproperty mentioned in some Aspose documentation does not exist onWorkbookSettingsin 26.4.0.
Environment
- Aspose.Cells for .NET 26.4.0 (NuGet)
- .NET 9.0
- Windows 11
- Behavior is independent of whether the source workbook was created in-process (synthetic repro) or loaded from a real customer XLSB
What we are asking
- Can Aspose.Cells 26.4.0 be made to emit a real, populated
xl/calcChain.bin(orxl/calcChain.xml) via existing public API? If yes, which combination ofWorkbookSettings,LoadOptions,SaveOptions, or method calls is required? - If no — please treat this as a defect. The end state we need is
Workbook.Save(path, new XlsbSaveOptions())producing a file whosexl/calcChain.binis the full calc chain that Excel would have written for the same workbook (so that Excel does not have to rebuild it cold on open). - If a fix is going to take time, please suggest a supported workaround. We considered post-processing the saved zip to delete
xl/calcChain.binentirely (forcing Excel to treat the file as having no chain at all rather than an empty one), but we are not sure whether that produces a different open-time path in Excel or just hits the same rebuild.
Thanks,
Oded Belahousky