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);
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.
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.
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.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.