I also faced the same issue, when I was developing a application which exports project contents into excel file.
I could not found the resolution in forums for my problem, then I check the maximum capacity of excel and found below link which says
"Worksheet size 1,048,576 rows by 16,384 columns" and this was the issue in my case, I was exporting more than that rows. Refer below link for details
Regards Prashant Neve