POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(file)); HSSFWorkbook wb = new HSSFWorkbook(fs); // after this has been executed, next error message come out and .. OPTIONS = 10 OPTIONS & 0x10 = 16 OPTIONS = 10 OPTIONS & 0x10 = 16 [WARNING] Unknown Ptg e (14) at cell (38,88) [WARNING] Unknown Ptg e (14) at cell (39,88) OPTIONS = 10 OPTIONS & 0x10 = 16 OPTIONS = 10 OPTIONS & 0x10 = 16 [WARNING] Unknown Ptg e (14) at cell (38,88) [WARNING] Unknown Ptg e (14) at cell (39,88) HSSFSheet sheet = null; HSSFRow row = null; HSSFCell cell = null; row = sheet.getRow(45); // at here next error occurrs and can't proceed more. java.lang.NullPointerException
Created attachment 4234 [details] this is excel file that make problem.
"Unknown Ptg" warning is expected, since POI cannot at the moment read logical formulaes. The null pointer exception is has nothing to do with that. IF the code you have pasted here is what you are running, then you WILL get such an exception, since your "sheet" variable IS null. You need to assing to sheet as sheet=wb.getSheetAt(0); that should work for you. BTW, which version of POI are you using?
Right, the bug as reported is invalid (see comment above). However, the attached spreadsheet throws up another issue. In the latest CVS, poi throws a java.lang.NegativeArraySizeException at org.apache.poi.hssf.record.SSTDeserializer.readStringRemainder(SSTDes erializer.java:335) I believe that the proximate cause is that the sheet contains Korean encodings. Any ideas?? Therefore reopening.
This looks complicated. Might be best off in 3.0.
Confirmed: Bug still exists in 2.0pre3
Check - bug still exists after recent changes for ExtSST by Jason ... boo hoo :(
See also bug 22742. Similar case, different workbook.
*** This bug has been marked as a duplicate of 22742 ***