"File Error: data may have been lost." seen in Excel 2007 and Excel 2003 SP3 when opening XLS file created with PHPExcel_Writer_Excel5

Topics: Developer Forum
Jan 7, 2008 at 3:26 PM
I would like to create Excel files that can be opened with "ordinary" Excel 2003 (standard installation, no compatibility pack).

Therefore I tried using PHPExcel_Writer_Excel5 to generate an XLS file, but when I open the file in Excel 2007 I first get the following alert box:

"File Error: data may have been lost."

Note that this happens even for "blank" spreadsheets. After clicking "OK" I see no problems with the file, though.

The same behavior is seen in Excel 2003 SP3. Before upgrading Microsoft Office 2003 with service pack 3 there was no such problem.

Others seem to have similar problems with other packages (perhaps similar code)

From what I read, the problem is that Excel 2007 is no longer compatible with Excel 95 spreadsheets, but only with Excel 97 spreadsheets and up. Same is the case for Excel 2003 with SP3.

Unfortunately, this makes PHPExcel_Writer_Excel5 much less useful.

Is there a workaround to this problem? I wouldn't mind sacrificing Excel 95 support.
Jan 7, 2008 at 6:45 PM
Edited Jan 7, 2008 at 6:49 PM
Will create a work item for this, but not sure how to fix...

In the meanwhile, check this URL: http://support.microsoft.com/kb/938810

(also mentioned as a bug in PEAR SpreadSheet Excel: http://pear.php.net/bugs/bug.php?id=9987)
Jan 7, 2008 at 6:55 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.