Free Support Forum - aspose.com

maxDataRow problem

Hi, I am using cells for java 1.8.2.0, my problem is that on method cells.getMaxDataRow(); returns -1.

String path = “d:/test.xls”;

InputStream inputStream = new FileInputStream(new File(path));

Workbook workbook = new Workbook();

workbook.open(inputStream);

Worksheets worksheets = workbook.getWorksheets();

Worksheet worksheet = worksheets.getSheet(“Base_Datos_AMEF”);

Cells cells = worksheet.getCells();

int maxDataRow = cells.getMaxDataRow();

System.out.println(maxDataRow);

There is test file in attachment.

Thanks.

Hi,

Since you are using some older version, Please try the attached version as it works fine.

Thank you.