XPathNamespace() in Excel2007.php

Topics: User Forum
Feb 3, 2009 at 11:41 AM
I'd like to test PHPExcel with this short script:

include_once("PHPExcel.php");
include_once("PHPExcel/IOFactory.php");
include_once("PHPExcel/Reader/Excel2007.php");



$reader = PHPExcel_IOFactory::createReader('Excel2007');
$reader->setReadDataOnly(true);

$excel = $reader->load('Test.xlsx');
$sheet = $PHPExcel->getActiveSheet();

$string = $sheet->getCell('A1')->getValue();
var_dump($string);


I have a problem with this error:

Fatal error: Call to a member function registerXPathNamespace() on a non-object in C:\Dokumente und Einstellungen\ ****** phpexcel\Classes\PHPExcel\Reader\Excel2007.php on line 228

can anybody help me with this problem?
Developer
Feb 3, 2009 at 2:23 PM
There must be something in that Excel file which Excel 2007 reader doesn't like. Can you send me the file (erik at phpexcel dot net)?

Feb 3, 2009 at 3:40 PM
You are right, the file was corrupt, I don't know why.

Thanks a lot!