Guys I\'m currently using the POI 3.9 library to work with excel files. I know of the getLastRowNum() function, which returns a number of rows in an Excel file.
getLastRowNum()
Try Sheet.getPhysicalNumberOfRows()