Why didn't PHPExcel work for me? - It does now!

Topics: Developer Forum, Project Management Forum, User Forum
Apr 7, 2009 at 8:45 PM
I have the latest distribution of php and it doesn't contain php_xml.dll. It says in the installation instructions that this is necessaary to get this working, so what am I to do? When I do try running it, I get this:

: ZipArchive::getFromName() [ziparchive.getfromname]: Invalid or unitialized Zip object in D:\www\PHPExcel\Classes\PHPExcel\Reader\Excel2007.php on line 205
Notice: Trying to get property of non-object in D:\www\PHPExcel\Classes\PHPExcel\Reader\Excel2007.php on line 206
Warning: Invalid argument supplied for foreach() in D:\www\PHPExcel\Classes\PHPExcel\Reader\Excel2007.php on line 206
Fatal error: Class 'PHPExcel_Writer_CSV' not found in D:\www\MarinaCape\index.php on line 35

I also have some older php distributions which also don't contain php_xml.php.

All I want to do is convert an xls spreadsheet (created in Excel 2007) into a csv (comma seperated values) file so that I can continue processing it in php.

Please help.
Apr 8, 2009 at 6:47 AM
Edited Apr 8, 2009 at 6:49 AM
In reply to my own query, and that of xquex "Zip Archive error" from feb 2.

The xls file that I was testing was created using an earlier version of Excel (not Excel 2007 as I had originally thought). To fix the problem, all I had to do was either load the file using a different reader class, or convert it first using the convert function in Excel2007.

As for php_xml.dll, I can't find it anywhere so am now assuming that it was assimilated into the main-stream php packages long ago.

On a programming note, how difficult would it be for PHPExcel to determine the version of the xls (or xlsx) file all by itself? You could have a method called loadExcelReader("file.xls") which would find the correct reader to match the file.
Apr 8, 2009 at 8:38 AM
Feature request automatically finding correct reader posted in issue tracker: