Problems Reading, then writing

Topics: User Forum
Oct 18, 2007 at 4:37 PM
Greetings;

Seeing as no one else seems to be having trouble with this, I'm sure I'm just doing something silly...
I'm attempting to open a simple spreadsheet (litterally a blank sheet with the word 'simple' in cell 'A1'). The sheet is saved using Excel 2007 as an .xlsx

I open that sheet using:
$oRead = new PHPExcelReaderExcel2007();
$oExcel = $oRead->load('simple.xlsx');

I then add the words 'Hello world' to cell 'A21':
$oExcel->setActiveSheetIndex(0);
$oExcel->getActiveSheet()->setTitle('Simple');
$oExcel->getActiveSheet()->setCellValue('A21', 'Hello world!');

I then try to write the sheet out to another file called:
$oWrite = new PHPExcelWriterExcel2007($oExcel);
$oWrite->save("test.xlsx");

When I attempt to open the test.xlsx in Excel 2007, I receive a few errors:
"Excel found unreadable content in 'test.xlsx'. Do you want to recover... (I choose 'Yes')"

The log of fixes contains:
Repaired part: /xl/Worksheets/sheet1.xml part with XML error, Load error, Line 29, column 42.
Repaired part: /xl/Worksheets/sheet2.xml part with XML error, Load error, Line 18, column 42.
Repaired part: /xl/Worksheets/sheet2.xml part with XML error, Load error, Line 18, column 42.
Removed Feature: Worksheet properties from /xl/worksheets/sheet1.xml part
Removed Feature: Worksheet properties from /xl/worksheets/sheet2.xml part
Removed Feature: Worksheet properties from /xl/worksheets/sheet3.xml part

Any advice appreciated.
Cheers,
Sean.
Coordinator
Oct 18, 2007 at 7:41 PM
No problem here... Can you post your code + simple.xls somewhere on the Internet and contact me trough the contact page?
Oct 19, 2007 at 2:09 PM
Correspondence sent using the contact page.
Coordinator
Oct 22, 2007 at 1:40 PM
This is fixed in 1.4.5b, can you test using that version?
Oct 22, 2007 at 2:41 PM
Works like a charm. Thank you for the quick response!
Cheers,
Sean.
Coordinator
Oct 22, 2007 at 7:43 PM
You're welcome!