Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.4

Bug #19278 File was corrupted
Submitted: 2012-02-06 14:07 UTC
From: arunravuri Assigned:
Status: No Feedback Package: Spreadsheet_Excel_Writer (version 0.9.3)
PHP Version: 5.2.6 OS: Windows7
Roadmaps: (Not assigned)    
Subscription  


 [2012-02-06 14:07 UTC] arunravuri (Arun Kumar)
Description: ------------ I was created a excel file in windows 7 and when i opened the file . I am getting "Excel found unreadable content. Do you want to recover the content of this work book? And file is opening in windows Xp/MAC. Test script: --------------- $excel = new Spreadsheet_Excel_Writer("Files/".$filename.".xls"); // add worksheet $sheet =& $excel->addWorksheet(); // create format for header row // bold, red with black lower border $firstRow =& $excel->addFormat(); $firstRow->setBold(); $firstRow->setSize(12); $firstRow->setColor('red'); $firstRow->setBottom(1); $firstRow->setBottomColor('black'); // add data to worksheet $rowCount=0; foreach ($data as $row) { foreach ($row as $key => $value) { if($rowCount==0) $sheet->write($rowCount, $key, $value,$firstRow); else $sheet->write($rowCount, $key, $value); } $rowCount++; } // save file to disk $excel->close();

Comments

 [2012-02-06 20:04 UTC] doconnor (Daniel O'Connor)
Hi Arun, are you suggesting this used to work (0.9.2); or is broken in previous versions as well?
 [2012-02-06 20:05 UTC] arunravuri (Arun Kumar)
it was not working in 0.9.2.
 [2012-02-07 16:33 UTC] aaaa (Krzysztof Ozga)
 [2012-02-12 20:57 UTC] harlequin76 (Lars Meyer)
hello! Had the same problem. Uninstalled Spreadsheet_Excel_Writer AND OLE and than installed not the latest version of OLE (1.0.0RC2) but OLE 1.0.0RC1 - solved the problem for me... have fun!
 [2012-02-23 05:55 UTC] koenigsegg (Torbjörn Stabo)
Harlequin76's solution worked for me as well, though downgrading OLE from 1.0.0RC2 to 1.0.0RC1 sufficed for me. (Spreadsheet excel writer v0.9.3, PHP 5.3.6)
 [2012-06-26 21:55 UTC] giox069 (Giovanni Panozzo)
Thank you Harlequin76: I solved the same problem downgrading OLE to 1.0.0RC1.
 [2012-07-16 12:01 UTC] sujimohan (Sujatha Mohan)
How to downgrade ole or how to Uninstall Spreadsheet_Excel_Writer AND OLE and to install OLE 1.0.0RC1
 [2012-07-16 15:17 UTC] sujimohan (Sujatha Mohan)
I have Downgraded to OLE 1.0.0RC1 but its not working. Any help
 [2012-11-30 21:54 UTC] drauka (Alex Schmidt)
Thank you harlequin, downgrading OLE to RC1 helped me as well! Great find.
 [2012-12-12 08:12 UTC] kenitr (Ken Loomis)
Downgrading to OLE 0RC1 fixed the problem on CentOS 6 but not CentOS 5
 [2013-08-27 20:33 UTC] devotee71 (Sirko Uhl)
downgrade to OLE 1.0.0RC1 and Spreadsheet 0.9.2. solved the Problem for me Debian -> PHP Version 5.2.9 THX a Lot
 [2013-09-21 21:18 UTC] maxmouse (Max Mouse)
Downgrading to php-pear-OLE 1.0.0 release 0.4.rc1.el6 (epel yum repo) worked for me on CentOS release 6.4
 [2014-01-24 00:17 UTC] chealer (Filipus Klutiero)
This affects me too, even with a VCS version of Spreadsheet_Excel_Writer. To downgrade on Windows: php pyrus.phar install pear/OLE-1.0.0RC1
 [2014-01-24 03:43 UTC] chealer (Filipus Klutiero)
The above comment assumes php-cli is present in the path and pyrus is in the current directory. An alternative is pear install OLE-1.0.0RC1 That one assumes pear is installed and in PATH.
 [2014-02-17 22:45 UTC] andygui (Andre Guibert de Bruet)
The downgrade to OLE 1.0.0RC1 worked for me as well. Thanks for the suggestion!
 [2014-03-25 02:07 UTC] jrklein (Jason Klein)
Downgrading to OLE 1.0.0RC1 resolved our problem as well. I only had to downgrade OLE. I did not have to downgrade Spreadsheet_Excel_Writer. Microsoft Excel 2010 on Windows 7 returned the following error when attempting to open files generated on Debian 7.4 with PHP 5.4.4, OLE 1.0.0RC2 and Spreadsheet_Excel_Writer 0.9.3. "The document is corrupt and cannot be opened. To try and repair it, use the Open and Repair command in the Open dialog box and select Extract Data when prompted." Open Office 3.4 was able to open the affected Excel files without error.
 [2017-03-25 05:13 UTC] sanmai (Alexey Kopytko)
-Status: Open +Status: No Feedback