LoadFromXLSSheet fails to load an Excel-document

LoadFromXLSSheet fails to load a Excel-sheet.


Errormessage and breakpoint just below the error line: FArray := ...

Worksheet.UsedRange returns there are 1048576 rows in this sheet. There is indeed effectively a cell at N:1048576. Is this intentional?

We improved code to deal with this situation without exception, but using 16 million cells for only 640 values will of course make it slow.

Ah that explains it :-) 


This is clearly not intentional - would it be possible to ignore cells with no content under import, so we don't end up with 1000000+ lines? I think I have seen this problem before.

I'm not sure if somewhere a line can be drawn to do this automatically. From what number of row should it start skipping for example. Different users will have different expectations from this. The current implementation imports all used cells as reported by Excel as-is in the grid which is the most reliable definition of the import action.

I tend to agree that it is different from user to user, so I think our options are:

1) Create an OLE-import from Excel of our own, which stops at the first blank line
2) Load the Grid with 1 mill. rows and delete from the first blank line to the end