Free Support Forum - aspose.com

Aspose.Cells allows invalid formula to be entered

I've recently updated from 5.0.0.0 to 7.0.1.0 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 5.0.0.0 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 7.0.1.0?

Thanks

Wayne

Hi,


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.


Hi,

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.

C#


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)”;


workbook.Save(filePath);

Thanks for the quick reply.