I got the same problem, and tracked it down to the a length problem.
When I create a working file with a certain length and add one character in any cell, the error appears.
I have generated the excel spreadsheet using Spreadsheet_Excel_writer. Every thing is working fine in Openoffice, but in MS Office when I try to open the generated spreadsheet it gives error message "File error: data may have been lost." but there is no data loss. How can we avoid this message.
This is happening only with MS Office 2007
Here is my code, <?php
-------
mb_internal_encoding('ISO-8859-1');
$workbook = new Spreadsheet_Excel_Writer();
$workbook->setVersion(8);
-----
?>