If you are using a .xls file then you are hitting the limit on the number of rows that can exist in a single worksheet within Excel.
You have a few options:
1. If possible upgrade your Excel installation to the latest version that uses .xlsx format
2. Split the data export to spread the results across two (or more) worksheets
3. Output as a CSV file - note you still won't be able to open it in older version of Excel
Quote:
Excel 2003 supports a maximum of 65,536 rows per worksheet
Microsoft Docs[
^]