I perform the actions: reassign formulas, this action occurs without error.
Then for some reason the file cannot be opened through Excel. The file is corrupted.
If I restore the file, the formulas are broken.
Aspose.Cells: 25.4.0
.NET: 9.0
If I do this on version 25.3.0 then the cells with formulas remain empty.
var input = @"C:\input.xlsx";
var output = @"C:\output.xlsx";
var workbook = new Workbook(input);
var ws = workbook.Worksheets.First();
var table = ws.ListObjects.First();
foreach (var col in table.ListColumns)
{
if (col != null)
{
var cellToApply = col.Range[1, 0];
if (cellToApply is {Formula: not null })
col.Formula = cellToApply.Formula; // <-- I think Problem here
}
}
workbook.CalculateFormula();
workbook.Save(output);