Free Support Forum - aspose.com

Formula returns null

I`m using aspose.cells 4.4.3.8 and for some cells I get a null when I call the formula method to retrieve the formula, although there is a formula in the excel file.

For most of the cells it`s OK, but there are some cases when the method returns null.

Hi,

Could you post your template file with sample code here, we will check it soon.

Thank you.

worksheet = workbook.Worksheets["Details"];

worksheet.Cells["C30"].Formula - returns the correct formula(=C9-C27)

worksheet.Cells["D30"].Formula - returns null instead of (=D9-D27)

Hi,

Thanks for considering Aspose.

Could you try the attached version (4.4.3.15) as I tested it using your template file and the formulas are retrieved fine.

Sample test code:

Workbook workbook = new Workbook();
workbook.Open("d:\\test\\formula\\test.xlsx",FileFormatType.Excel2007Xlsx);
Worksheet worksheet = workbook.Worksheets["Details"];
MessageBox.Show(worksheet.Cells["C30"].Formula);// - returns "=C9-C27)"
MessageBox.Show(worksheet.Cells["D30"].Formula);// - returns "=D9-D27"

Thank you.