Using POI-3.0.1-FINAL I have Excel files that are created by a third party utility (Actuate iServer). Most files open as HSSFWorkbook without problem. Some files are reporting a RecordFormatException. If I open the problem files with Microsoft Office Excel 2003, the files open correctly. If I save the file (no changes) using same, then they open with HSSFWorkbook just fine. I have attached a small Eclipse project with one Java program that demonstrates the problem. Just run the OpenFileError program and you should get the error. thanks
Created attachment 20886 [details] Eclipse Project that shows problem behavior. Includes problem Excel File. Eclipse Project that shows problem behavior. Includes problem Excel File.
That file is really quite messed up :( It's no good trying to catch the AIOOB exception and skip on, as by then the whole input stream is messed up, and the next record to try to read some data blows up with something else. No idea where the original problem is occuring, only that when we try to read one particular sub-record we're out of data, and probably should've stopped long long ago I can't see us being able to handle these files, sorry, they're just too cryptically broken. Probably your best bet is to script excel to open and re-save them, as that has a workaround for whatever corruption these files have.