Problem reading/calculating formulas


#1

Aspose.Cells seems to have a problem reading and calculating some of the formulas. This is made even worse by the fact that it's not even throwing an error. Please refer to the attached spreadsheet and code below. The formulas in E59:I:59 are not retrievable, and aren't being calculated properly (value should show a zero instead of nothing). Also, J59 is inconsistent with it's own formula in that it is no longer the sum of E59:I59.

static void Main(string[] args)
{
Aspose.Cells.License license = new Aspose.Cells.License();
//set License

Aspose.Cells.Excel excel = new Aspose.Cells.Excel();
excel.Open(@"AsposeWorkbook.xls");
System.Console.Out.WriteLine("Original Values");
PrintCell(excel.Worksheets[2].Cells["E59"]);
PrintCell(excel.Worksheets[2].Cells["F59"]);
PrintCell(excel.Worksheets[2].Cells["G59"]);
PrintCell(excel.Worksheets[2].Cells["H59"]);
PrintCell(excel.Worksheets[2].Cells["I59"]);
PrintCell(excel.Worksheets[2].Cells["J59"]);
excel.Worksheets[3].Cells["D12"].PutValue("AsposeTest");
excel.Worksheets[3].Cells["I19"].PutValue(250);
excel.Worksheets[3].Cells["I21"].PutValue("False");
excel.Worksheets[3].Cells["I23"].PutValue("True");
excel.CalculateFormula(false);
System.Console.Out.WriteLine("\nValues After Calculation");
PrintCell(excel.Worksheets[2].Cells["E59"]);
PrintCell(excel.Worksheets[2].Cells["F59"]);
PrintCell(excel.Worksheets[2].Cells["G59"]);
PrintCell(excel.Worksheets[2].Cells["H59"]);
PrintCell(excel.Worksheets[2].Cells["I59"]);
PrintCell(excel.Worksheets[2].Cells["J59"]);
}

static void PrintCell(Aspose.Cells.Cell cell)
{
System.Console.Out.WriteLine("cell[{0}].Value == {1}\ncell[{0}].Formula == {2}",
cell.Name, cell.StringValue, cell.Formula);
}

Thanks

Shari


#2

Hi Shari,

Please try this attached version.