We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Calculation not working when a value is set inside table

When I open the attached file and run the following code, the resulting file does not calculate correctly.

Files:
TestTable.xlsx (Source file)
TestTable2.xlsx (sample output file generated with the code below. Note: the cells in row 15+ do not recalculate)

Code (VB.NET) - Note: Actual paths are omitted.

Dim wb = New Aspose.Cells.Workbook(“Testtable.xlsx”)

    Dim sh = wb.Worksheets.Item(0)

    sh.Cells.InsertRow(2)
    sh.Cells.GetCell(2, 0).PutValue(10)
    'sh.Cells.GetCell(2, 2).PutValue(12)


    wb.Save("Testtable2.xlsx")

Issue:
Formulas do not recalculate. Do not recalculate on F9, Shift-F9, F2 or when UI is used to recalculate. Only way to recalculate is to edit the formula cells and press enter.
ReportTemplates.zip (14.8 KB)

@kunab,

Please add a line to your code segment, it will work ok as I tested:
e.g.
Sample code:

Dim wb = New Aspose.Cells.Workbook(“Testtable.xlsx”)

Dim sh = wb.Worksheets.Item(0)

sh.Cells.InsertRow(2)
sh.Cells.GetCell(2, 0).PutValue(10)
'sh.Cells.GetCell(2, 2).PutValue(12)

wb.CalculateFormula()

wb.Save(“Testtable2.xlsx”)

Let us know if you still find any issue.