Version 3.5-beta4 had problem with reading XLS saved in Office 2007, this was fixed in 3.5-beta5, but now not working document saved in old Office 2003. It's possible fix it for booth version? Here is Exception: Exception in thread "main" org.apache.poi.hssf.record.RecordFormatException: Duplicate PageSettingsBlock record (sid=0x89c) at org.apache.poi.hssf.record.aggregates.PageSettingsBlock.checkNotPresent(PageSettingsBlock.java:227) at org.apache.poi.hssf.record.aggregates.PageSettingsBlock.readARecord(PageSettingsBlock.java:215) at org.apache.poi.hssf.record.aggregates.PageSettingsBlock.addLateRecords(PageSettingsBlock.java:639) at org.apache.poi.hssf.model.Sheet.<init>(Sheet.java:222) at org.apache.poi.hssf.model.Sheet.createSheet(Sheet.java:158) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:286) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:200) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:316) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:297) at cz.atomsoft.actum.carrefour.carrefourhelper.tasks.XlsToAccessConverter.convert(XlsToAccessConverter.java:90) at cz.atomsoft.actum.carrefour.carrefourhelper.tasks.XlsToAccessConverter.convert(XlsToAccessConverter.java:78) at cz.atomsoft.actum.carrefour.carrefourhelper.tasks.XlsToAccessConverter.searchFolderAndConverAllFiles(XlsToAccessConverter.java:73) at cz.atomsoft.actum.carrefour.carrefourhelper.tasks.XlsToAccessConverter.process(XlsToAccessConverter.java:59) at cz.atomsoft.actum.carrefour.carrefourhelper.App.main(App.java:23)
Created attachment 24399 [details] XLS saved in o2003 it work in old 3.5 beta 4
Created attachment 24400 [details] XLS saved in O2007 it work in 3.5 beta 5 and 3.5 final
Created attachment 24608 [details] Excel 2000 Document (for test case) I added an Excel 2000 file for testing purposes. I am getting the mentioned RecordFormatException in 3.5-FINAL but 3.5-beta4 works fine. Here's my test code: static void copyPoi( File xlsFile ) throws Exception { File tgt = new File( xlsFile.getParentFile(), xlsFile.getName() + ".P.xls" ); HSSFWorkbook wbook = new HSSFWorkbook( new FileInputStream( xlsFile ) ); FileOutputStream out = new FileOutputStream( tgt ); wbook.write( out ); out.close(); } I'd really appreciate a fix for this issue very soon. Maybe if someone could give me direction I'd be able to look in the concerning source-code myself...
Fixed in r892468 It took time to understand the meaning of the duplicate records and how Excel 2007 repositions them when saving such a file. The fix mimics Excel 2007: duplicates in PageSettingsBlock are not ignored. In the observed cases they are related to custom sheet views and Excel 2007 moves them to the appropriate block. So does POI. Yegor
*** Bug 48852 has been marked as a duplicate of this bug. ***