PHPExcel 1.8.0 : Unable to load external sheet

Topics: Developer Forum
May 26, 2014 at 4:54 PM
Edited May 27, 2014 at 4:09 AM

I successfully used previous versions of PHPExcel (prior to 1.8.0) to create multiple worksheets and write to disk (saved in /tmp), after creating and writing about 8 excel documents I would then load all 8 sheets into 1 large excel document as 8 individual tabs and save to disk. This worked well.

I upgraded to PHPExcel 1.8.0: I am able to create the 8 documents but unable to load them into the large excel document.

The error in Excel2007.php is at line 364:
$wbRels = simplexml_load_string($this->_getFromZipArchive($zip, "xl/_rels/workbook.xml.rels"), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());

$wbRels is null. So this line: foreach ($wbRels->Relationship as $rel) { ... does not load anything.

After running my code a random number of times, PHPExcel creates the directories _rels, docProps, & xl in the root folder with various files in them. If I remove these folders I am able to load the external sheets into 1 large excel document. When these files/folders exist, I get the error above.

OS: Ubuntu 12.04
May 27, 2014 at 1:09 PM
Commenting out lines 320-324 in Classes/PHPExcel/Reader/Excel2007.php

//if (strpos($fileName, '//') !== false)
// $fileName = substr($fileName, strpos($fileName, '//') + 1);
//$fileName = PHPExcel_Shared_File::realpath($fileName);

solves the problem. The directories _rels, docProps, & xl were being created by another processes that reads xlsx files.