https://issues.apache.org/bugzilla/show_bug.cgi?id=53314

--- Comment #9 from Pete Maher <[email protected]> ---
Hi Mark

Yes your suggestion works ... with a limitation! (although this bit isn't
critical for me currently as the workbooks I am working with are fairly small)

If you get all referenced cells of the new AreaReference - IE
CellReference[] crefs = aref.getAllReferencedCells();
Then crefs.length = 65536.  I was expecting 1048576.

Also crefs[i].sheetName == null should be expected given that reference passed
in didn't include a sheet name, no big deal.

So your workaround will is fine so long as there is not data beyond row 65536.

I've coded my own workaround for the timebeing - a bit of  a hack but basically
getting the first and last actual rows of the Sheet so I change "Sheet1!$A:$A"
to "Sheet1!$A1:$A2345" (Basically I didn't like that getAllReferencedCells()
would return a huge array whilst I was only using about 1300 rows within the
named column range).

ASIDE:  if aref.getAllReferencedCells() were to be used on a sheet with values
in the first and last rows only it would reach an out of memory pretty soon if
fixed for the 65536 limit (especially if the range contained multiple columns)
- Therefore could probably do with a  new AP method to get all cells *actually*
in use in an area rather than referenced by the area.  This would involve
iterating over all the cells in the range so would be slower than
getAllReferencedCells() but for sparsely populated ranges (typically whole
column and whole row ranges) is a better option than running out of resources.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to