I have exception when open an xls file. The error only occurs for my "test.xls", it is ok for my "ok.xls". Both of them are created by Excel 2000. The only difference between text.xls and ok.xls at row#2 column I. The cell value of the cell is "01/05 (Wed)" I cannot attach my xls here, please advise if I could upload the problem xls. Thanks below is the code ----begin code--------- import org.apache.poi.hssf.usermodel.*; import org.apache.poi.poifs.filesystem.*; import java.io.*; class abc { public static void main(String args[]) throws Exception { POIFSFileSystem fs=new POIFSFileSystem(new FileInputStream("test.xls")); //POIFSFileSystem fs=new POIFSFileSystem(new FileInputStream("ok.xls")); HSSFWorkbook wb=new HSSFWorkbook(fs); } } ---end code------------- below is the stack dump ---- begin dump----- java.lang.reflect.InvocationTargetException: java.lang.IllegalArgumentExceptionp at org.apache.poi.util.BinaryTree.insertValue(BinaryTree.java:1395) at org.apache.poi.util.BinaryTree.put(BinaryTree.java:1580) at org.apache.poi.hssf.record.SSTRecord.processString(SSTRecord.java:10) at org.apache.poi.hssf.record.SSTRecord.manufactureStrings(SSTRecord.ja) at org.apache.poi.hssf.record.SSTRecord.fillFields(SSTRecord.java:818) at org.apache.poi.hssf.record.Record.fillFields(Record.java:142) at org.apache.poi.hssf.record.Record.<init>(Record.java:104) at org.apache.poi.hssf.record.SSTRecord.<init>(SSTRecord.java:161) at java.lang.reflect.Constructor.newInstance(Native Method) at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.) at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:) at abc.main(abc.java:12) Exception in thread "main" org.apache.poi.hssf.record.RecordFormatException: Unl at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.) at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:) at abc.main(abc.java:12) ----end dump------
Created attachment 1830 [details] cannot open this xls
Created attachment 1831 [details] This is the one that could open
Fixed. Please check.
It works. Thank You.