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

Free Support Forum - aspose.com

Formula returns null

I`m using aspose.cells 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.


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)


Thanks for considering Aspose.

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

Sample test code:

Workbook workbook = new Workbook();
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.