Free Support Forum -

Aspose.Cells allows invalid formula to be entered

I've recently updated from to and found that I can now assign an invalid formula to a cell. For example "=IF(a x 1, 1, 2)" can't be entered directly into Excel but can be assigned via Aspose.Cells and saved. The resulting behaviour in Excel varies depending on the formula; sometimes it displays "#NAME?" and sometimes nothing.

Aspose.Cells would throw an error condition if an invalid formula was assigned to a cell.

Is this an intended change in behaviour? Is there a way to validate the formula in




Could you give us sample code (and template file etc.) to show the issue, we will check it soon.

Thank you.

I don't have a stand-alone example (the problem occurred in a large application), however you can reproduce the problem by creating a new workbook and assigning the example formula I gave, eg:

WorkBook.Worksheets[0].Cells[1, 1].Formula = "=IF(a x 1, 1, 2)";

This statement used to throw an error. Now you can save the formula in the workbook and open it in Excel.


I found, the latest version generates a corrupted xlsx file using the following code.

We will investigate this issue and fix the problem asap.

This issue has been logged as CELLSNET-30604.


string filePath = @“F:\Shak-Data-RW\Downloads\output.xlsx”;

Workbook workbook = new Workbook();

Worksheet worksheet = workbook.Worksheets[0];

worksheet.Cells[“A1”].Formula = “=IF(a x 1, 1, 2)”;


Thanks for the quick reply.