CODE: public class XSLExample { public XSLExample() { } public static void main(String[] args) throws IOException { POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream("sqm.xls")); HSSFWorkbook wb = new HSSFWorkbook(fs); System.out.println("Tot Sheet: " + wb.getNumberOfSheets()); for (int i=0; i < wb.getNumberOfSheets(); i++) { System.out.println(wb.getSheetName(i)); } } } ERROR: java.lang.reflect.InvocationTargetException: java.lang.IllegalArgumentException: Illegal length at org.apache.poi.util.StringUtil.getFromUnicodeHigh (StringUtil.java:115) at org.apache.poi.hssf.record.FontRecord.fillFields (FontRecord.java:172) at org.apache.poi.hssf.record.Record.fillFields(Record.java:143) at org.apache.poi.hssf.record.Record.<init>(Record.java:105) at org.apache.poi.hssf.record.FontRecord.<init>(FontRecord.java:125) at java.lang.reflect.Constructor.newInstance(Native Method) at org.apache.poi.hssf.record.RecordFactory.createRecord (RecordFactory.java:254) at org.apache.poi.hssf.record.RecordFactory.createRecords (RecordFactory.java:192) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init> (HSSFWorkbook.java:181) at innesto.XSLExample.main(XSLExample.java:24) org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance, the following exception occured: null at org.apache.poi.hssf.record.RecordFactory.createRecord (RecordFactory.java:267) at org.apache.poi.hssf.record.RecordFactory.createRecords (RecordFactory.java:192) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init> (HSSFWorkbook.java:181) at innesto.XSLExample.main(XSLExample.java:24) Exception in thread "main"
Created attachment 3876 [details] file excel (XP) with password protection
http://jakarta.apache.org/poi/faq.html#faq-5