for(int i = 1; i < 400; i++) { HSSFRow row = sheet.getRow(i); //this line fails for empty row HSSFCell cell = row.getCell((short)0); value = cell.getStringCellValue(); System.out.println("" + i + "\t"+ value); } The above code breaks when it encounters a blank line. I get a null pointer exception on the line following the last data line - java.lang.NullPointerException at org.apache.poi.hssf.usermodel.HSSFRow.<init>(HSSFRow.java:123) at org.apache.poi.hssf.usermodel.HSSFSheet.getRow(HSSFSheet.java:311) at accesslog.ReadXls.main(ReadXls.java:38) Exception in thread "main" I'm using the dev version of POI (I got it from the CVS on 3rd May, so its a bit old). cheers Conrad
Works as of 12Jan2007, Testcase added. http://issues.apache.org/bugzilla/show_bug.cgi?id=41366