I have this problem a lot, especially in .xlsx spreadsheets. First of all, make sure there is not a row 65382 rows down with something in it. I've seen that, I think even a space can cause this. What usually happens, though, is the internal pointers in the spreadsheet think there is something way out down there when there isn't, and it loads all of the empty or non-existent rows between, times out, and bye bye program. I have critical processes that absolutely must complete, and this is a real show stopper.
What I do that solves this is to load the spreadsheet into LibreOffice ( I suppose you can use Excel if you must, I personally avoid Microsoft products but that is another story) and then just save it again. I save it as an .XLS, not .XLSX, and this fixes the problem most of the time. For reasons unknown to me, saving as .XLS instead of .XLSX can fix the problem. On those rare occasions when it doesn't, I have to copy/paste the contents of the spreadsheet into a new blank spreadsheet, and that fixes it.
One of the above fixes it 100% of the time.
I really wish we could specify a limit to the number of rows/columns when we do toArray because otherwise it times out. Sometimes I do this in an unattended session via ssh, and I don't know it failed until my users complain.
What I do that solves this is to load the spreadsheet into LibreOffice ( I suppose you can use Excel if you must, I personally avoid Microsoft products but that is another story) and then just save it again. I save it as an .XLS, not .XLSX, and this fixes the problem most of the time. For reasons unknown to me, saving as .XLS instead of .XLSX can fix the problem. On those rare occasions when it doesn't, I have to copy/paste the contents of the spreadsheet into a new blank spreadsheet, and that fixes it.
One of the above fixes it 100% of the time.
I really wish we could specify a limit to the number of rows/columns when we do toArray because otherwise it times out. Sometimes I do this in an unattended session via ssh, and I don't know it failed until my users complain.