IChartDataWorkbookCalculateFormulas Method

Calculates all formulas in the workbook and updates corresponding cells values.

Namespace:  Aspose.Slides.Charts
Assembly:  Aspose.Slides (in Aspose.Slides.dll) Version: 21.11.0.0 (21.11)
Syntax
void CalculateFormulas()
Exceptions
ExceptionCondition
CellCircularReferenceExceptionWorkbook contains formulas with a circular reference.
CellUnsupportedDataExceptionCell data is not supported.
Examples
Example shows how to assign a formula to the cell and to calculate a value. The value of the "B4" cell is getting set to 5.
[C#]
using (Presentation pres = new Presentation())
{
    IChart chart = pres.Slides[0].Shapes.AddChart(ChartType.Pie, 100, 100, 300, 400);
    IChartDataWorkbook wb = chart.ChartData.ChartDataWorkbook;
    wb.GetCell(0, "B2", 2);    
    wb.GetCell(0, "B3", 3);    
    wb.GetCell(0, "B4").Formula = "B2+B3";
    wb.CalculateFormulas();
    ...
}
See Also