Excel2007 reader slowness

Mar 13, 2009 at 3:29 AM
When using the excel2007 reader with many named ranges and multiple sheets, it takes longer then an hour to read the file.
I believe that the problem is that setTitle() is called twice per sheet when reading, and this call, calls the following function which iterates through each worksheet and every cell.
//PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->getParent(), $oldTitle, $newTitle);
When loading the excel file, I don;t think that we need to call this function since all the named ranges should be correct, and we should only have to update the named ranges when we actually really change the name of a worksheet using PHPExcel.
My templates were taking over 80 minutes to load, and when I commented out the line above, it can read the template super fast again.

I did run across one issue though that I am not sure if it is related.  In worksheet.php, getCell calls extractSheetTitle if it is a worksheet reference.  extractSheetTitle returns 'Main Filtered' but the actual sheet name is Main Filtered.  So getSheetByName fails since there is no sheet called 'Main Filtered'  only Main Filtered.
extractSheetTitle has //$reference[0] = str_replace("'", "", $reference[0]); commented out since it would not work for names such as Frank's sheet.
I fixed my problem by  modifying PHPExcel.php modifying getSheetByName to also chec
if ($this->_workSheetCollection[$i]->getTitle() == $pName || "'" . $this->_workSheetCollection[$i]->getTitle() . "'"  == $pName)
Mar 13, 2009 at 1:40 PM
As for your second paragraph, a work item has been created for that:

As for the slowness of the reader, I think you are right. Will check up on this.

Mar 27, 2009 at 6:19 PM
Edited Apr 1, 2009 at 4:04 PM
If you can afford to downgrade to 1.64 it will reduce the execution time but not siginifcantly