Excel biff5 to biff8 conversion

99封情书 提交于 2019-12-10 13:45:38

问题


My system uses Apache-POI to manage some xls files. Now I've got almost 300 xls files, but it appears that they are in an old format so i got this exception:

The supplied spreadsheet seems to be Excel 5.0/7.0 (BIFF5) format. POI only supports BIFF8 format (from Excel versions 97/2000/XP/2003)

Is there a way to handle that or to automatically convert all those files to a biff8 format?


回答1:


Go with converting it to OOXLS format, POI supports both BIFF8 and newer OOXLS. Download official Microsoft converter pack:

http://www.microsoft.com/en-us/download/details.aspx?id=3

Convert files by running excelcnv.exe -oice <input file> <output file>. You can try run it directly from your code as external program, or create some batch file. There is a good explanation from mrdivo at social msdn here.

EDIT

The download mentioned above from microsoft.com is no longer available as of 6/21/2018. However, excelcnv.exe is a standard part of some Microsoft Office installations. It has been confirmed to be deployed with Office 2014 and Office 2016, and possibly other versions. It can be found at:

C:\Program Files (x86)\Microsoft Office\root\Office16` (or `Office14`).



回答2:


It seems apache-POI can't handle BIFF5 format.

You should try to use Java Excel API instead : http://jexcelapi.sourceforge.net/



来源:https://stackoverflow.com/questions/12428931/excel-biff5-to-biff8-conversion

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