Input string not in correct format while loading XSLX file

Hi,

I think I just ran into a bug in Aspose 4.7.0.0.

I'm trying to import Excel files to perform validation rules on their data. The columns contain mixed literal and numeric values, so I set the ConvertNumericData property of the workbook to False.
It works well with XLS and CSV files but the method Workbook.Open throws an exception with Excel 2007 files :

"Input string not in correct format" at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)

It only happens when columns contains mixed numeric and literal data, with numeric data in the first row.

Here is the code used :

Workbook wb = new Workbook();
wb.ConvertNumericData = false;
wb.Open(fsExcel, FileFormatType.Excel2007Xlsx);

Can you provide a fix or a workaround ?

Thanks in advance.

Hi,

Could you post your template xlsx file, we will check your issue soon.

Thank you.

Here is a sample file.

The problems comes from the "coef1" column. If the first row is "1" (like in this file), the column is handled as numerical data and an exception is thrown for the "a". If the first row is a text value, no exception is thrown.

Hi,

Could you try the attached version (4.7.0.4) and let us know if it works fine. I have tested using your template Xlsx file and code with it, it works fine without producing any error.

Thank you.

It works, thanks a lot !

Can this build be used on a production environment, or do I have to wait for an official release ?

Hi,

Yes, sure it can be used. This fix (Aspose.Cells for .NET V 4.7.0.4) is an intermediate kind of version which is provided as a fix against some bugs. Normally, a bug fix version is posted in the support forums. You can use this fix for your requirements; it will behave like an official release. It is to be noted here, our next official release would include all the functionality of the previous fixes (including all the intermediate versions till the next official release). Also, our next official release is planned to be released before the end of the next week.

Thank you.