Are you on a 32-bit platform? There you certainly run out of memory - switch to the 64-bit Lazarus where I just confirmed that 1M rows can be written to xlsx successfully (the limitation of the file format is at 1,048,576 rows (and 16,384 columns)); it takes some time, though...
Can't resist to ask this question: With so many rows, are you sure that a spreadsheet is the correct tool?