Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel biff5 to biff8 conversion

Tags:

xls

apache-poi

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?

like image 647
Vadym Kovalenko Avatar asked Sep 14 '12 17:09

Vadym Kovalenko


Video Answer


1 Answers

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`).
like image 69
user2622016 Avatar answered Dec 27 '22 10:12

user2622016