Accessing farthest rows in CSV file causes an exception "java.lang.IllegalArgumentException: Invalid row index." in Java

hi,

we read a csv file and facing a problem when there are more than 1.048.600 rows

cells.getMaxDataRow()
(int) 1115607

returns the correct number of rows

but if we try to access a row bigger than about 1048600 we get the following error
cells.get(1048600, 1);

java.lang.IllegalArgumentException: Invalid row index.
at com.aspose.cells.zarf.a(Unknown Source)
at com.aspose.cells.Cells.get(Unknown Source)

where smaller rows return the correct cell
cells.get(1048500, 1);
(com.aspose.cells.Cell) Aspose.Cells.Cell [

could you please check, what the issue is, is there a restriction on rows?

brn

@rbi-sw-dev,
MS Excel allows 1,048,576 rows only therefore no file can be handled having rows more than this number. As Aspose.Cells mimics the behavior of MS Excel, hence it also does not allow handling rows after the maximum allowed number. Hence it is the expected behavior of Aspose.Cells.

For your reference visit the link below:
Excel specifications and limits

thanks for the fast answer and explanation
we will try to avoid to use aspose for csv in the future

@rbi-sw-dev,

You are welcome. I would just try to clarify further that this limitation is imposed by MS Excel and nothing to do with Aspose.Cells. In the event of further queries or comments regarding Aspose APIs, feel free to write us back.

1 Like