What versions of Excel supported?

Dec 17, 2010 at 8:18 PM

I am using

"HSSFWorkbook myWorkbook = new HSSFWorkbook(streamFileName);   Where we have

This code works sometimes (aka depending on the file we get from a 3rd party).  We don't know how they generate the xls file or what version of excel the file was created under but it seems to error out on certain files (if we knew what version were supported, we could then go back to the 3rd party and request the files be created w/ said version).  Is there a definitive reason why files would fail (wrong version of excel => what versions are acceptable, ..., also any other requirements like no macros, etc.).  Note: the file that produced exceptions, if I simply resave the file as csv and re-import in Microsoft Office Excel 2005, it works.

The exception being thrown : "Invalid header signature; Read xxxxx, expected xxxx". 

Dec 30, 2010 at 2:47 AM

csv is not standard xls file. it's plain text. However, if the file is previously csv and someone change the extension directly to xls, NPOI cannot recognize it. NPOI only support OLE2 files. For excel, only files after Excel 97 (BIFF 6, BIFF 7) are supported. Some formats like Excel 3.0 are not supported.