how to solve JXL error : jxl.read.biff.BiffException: Unable to recognize OLE stream

余生颓废 提交于 2019-11-30 17:19:05
Vinod Kumar Chauhan

I was also facing this problem earlier. I googled and read this post and many other posts that were asking for solution to this BiffException. I don't have the exact solution but as I fixed my problem you can do it too, perhaps.

I was trying to read data from the Excel file saved in MS Office 2010 and I was getting this error. I saved the file as an Excel 2003-7 and then read it without any problem. It may the case that this problem occurs in Office 10 but not in Office 2003-7.

I hope this will work in your case.

Saving File as "Excel 97-2003 Workbook" type solved my issue.

prasad vsv

JXL library doesnot support .csv and .xslx formats, which is the format used by Excel-2010. hence, use Excel 97-2003 which is .xls foramatted and is supported by JXL library. or else if you want to use excel-2010, use APACHE POI(XSSFWorkbooks) instead of JXL. For using .csv format, google for CSVReader libraries.

Save the Excel file type as Excel 97-2003 Worksheet and extension type as xls

JXL is a simple (and hence limited) API. If it says

Unable to recognize OLE stream

it is what it is. It doesn't quite understand your Excel XLS file. Have confidence that the error is legitimate. This API only supports *.xls files; it doesn't support, for example, *.csv or *.xlsx files. Obviously, having the file renamed to *.xls alone is not sufficient. It must be in Excel 97-2003 format too.

  • Copy all the cells from your *.csv or *.xlsx file.
  • Open MS Excel and paste the copied cells.
  • Save the file as MS Excel 97-2003 (*.xls) file.

This error will surely not appear again.

On the other hand, if you want to process other formats (xlsx, csv) directly, look for other tools like Apache POI.

Actually you are using different version of csv file .Please save it in the exact version.

For ex: we should save the excel sheet in word as 9

save the file as Excel 97-2003 and also change the file format from xlsx to xlx , in the code(in the file name)

I was trying to read data from the Excel file saved in MS Office 2010 and I was getting this error. I saved the file as an Excel 2003-7 and then read it without any problem. It may the case that this problem occurs in Office 10 but not in Office 2003-7

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!