Free Support Forum -

Invalid formula error for .xlsx file format - Aspose Cells( using java


Please find the attached excel file.

1) In the attached excel, in Sheet 'TEST', i have the following formula in the cell C8.

=MIN(Sheet2!E14*'Test Page'!$E$54,Sheet2!D14*3%) + MIN(Sheet2!G14*'Test Page'!$E$54,Sheet2!D14*3%)

the following java code(with Aspose.Cells and correct libs) works fine when i execute with the above excel.

Workbook workbook = new Workbook("Book-formula.xlsx");
Worksheet worksheet = workbook.getWorksheets().get("TEST");
Cells cells = worksheet.getCells();

2) now i copied the following formula as it is in the same cell(C8),

=MIN(Sheet2!E14*'Test Page'!$E$54,Sheet2!D14*3%) +
MIN(Sheet2!G14*'Test Page'!$E$54,Sheet2!D14*3%)

The following exception comes when i execute the above java code.

com.aspose.cells.CellsException: Error in Cell: C8-Invalid formula."MIN(Sheet2!E14*'Test Page'!$E$54,Sheet2!D14*3%) +
MIN(Sheet2!G14*'Test Page'!$E$54,Sheet2!D14*3%)".

Note: both above formulas works fine if the file of type .xls.

Any idea why I would get these exceptions?



Thanks for your posting and using Aspose.Cells for Java.

Please download and use the latest version:
for Java v7.3.2.1

and see if it resolves your issue.

I tried your file with the following code but I was unable to reproduce your exception. Please provide us your complete sample runnable code replicating this exception.

We will look into it and help you asap.


String filePath = “F:\Shak-Data-RW\Downloads\Book-formula.xlsx”;

Workbook workbook = new Workbook(filePath);

Worksheet worksheet = workbook.getWorksheets().get(“TEST”);

Cells cells = worksheet.getCells();


Cell cell = cells.get(“D10”);


workbook.calculateFormula(); + “.out.xls”);