Created attachment 31545 [details] Java Class and Excel file to run the bug. On some of my Excel files, POI throws a NulPointerException on HSSFRow.getLastRowNum() method. I have made a synthetic Excel file and a sunthetic Java class, which are in the attachment, to present this bug.
Have you checked that the row isn't null? Sheet.getRow(int) can return null if the row has never been used or styled
Ok, I'm sorry : you're right, I didn't think the row befor the last row could be null. Thank you :-). Lionel