When trying to create a reader for a file, I get some strange errors. I was using the dev-master branch, then switched to 1.8.1 but that didn't seem to make any difference therefore I'm thinking it's the spreadsheet that's the problem.
There are quite a lot of formulas used in the spreadsheet, for example:
=IFERROR(VLOOKUP($A$1*1,'List'!A:H,P5,FALSE),"")
=IF(A15>0,1,"")
=IFERROR(VLOOKUP($A15,'Master'!$A:$R,18,FALSE)*P15,"")
=IF(A16=0,"",IFERROR(VLOOKUP($A16,'Master'!$A:$O,2,FALSE),"Not Available"))
PHP:
$objReader = \PHPExcel_IOFactory::createReaderForFile($filename);
$r = $objReader->load($filename);
Error:
PHP Notice: Undefined index: $ in
/var/www/html/myApp/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php
on line 809 PHP Stack trace: PHP 1. {main}()
/var/www/html/myApp/app/console:0 PHP 2.
Symfony\Component\Console\Application->run()
/var/www/html/myApp/app/console:22 PHP 3.
Symfony\Bundle\FrameworkBundle\Console\Application->doRun()
/var/www/html/myApp/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:121
PHP 4. Symfony\Component\Console\Application->doRun()
/var/www/html/myApp/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:96
PHP 5. Symfony\Component\Console\Application->doRunCommand()
/var/www/html/myApp/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:191
PHP 6. Symfony\Component\Console\Command\Command->run()
/var/www/html/myApp/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:904
PHP 7. App\MyApp\ImportBundle\Command\ImportCommand->execute()
/var/www/html/myApp/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:244
PHP 8. App\MyApp\ImportBundle\ImportService->import()
/var/www/html/myApp/src/App/MyApp/ImportBundle/Command/ImportCommand.php:35
PHP 9. App\MyApp\ImportBundle\Other\Importer->import()
/var/www/html/myApp/src/App/MyApp/ImportBundle/ImportService.php:44 PHP
10. App\MyApp\ImportBundle\Other\Importer->createAllocation() /var/www/html/myApp/src/App/MyApp/ImportBundle/Other/Importer.php:43
PHP 11.
App\MyApp\ImportBundle\Other\AllocationImporter->import()
/var/www/html/myApp/src/App/MyApp/ImportBundle/Other/Importer.php:70
PHP 12.
App\MyApp\ImportBundle\AbstractSpreadsheetReader->loadSpreadsheet()
/var/www/html/myApp/src/App/MyApp/ImportBundle/Other/AllocationImporter.php:26
PHP 13. PHPExcel_Reader_Excel2007->load()
/var/www/html/myApp/src/App/MyApp/ImportBundle/AbstractSpreadsheetReader.php:31
PHP 14. PHPExcel_Worksheet_AutoFilter->setRange()
/var/www/html/myApp/vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel2007.php:1012
PHP 15. PHPExcel_Cell::rangeBoundaries()
/var/www/html/myApp/vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet/AutoFilter.php:131
PHP 16. PHPExcel_Cell::columnIndexFromString()
/var/www/html/myApp/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php:729
One problem is formulae like
=IFERROR(VLOOKUP($A$1*1,'List'!A:H,P5,FALSE),"")
PHPExcel doesn't fully support row or column references like 'List'!A:H
or 'Master'!$A:$R
It does support range references however, so 'List'!A1:H1000
or 'Master'!$A1:$R1024
would be valid
EDIT
However, from the stack dump, it looks like a problem in an autofilter
As a "Quick and Dirty" hack, you might check the file Classes/PHPExcel/Cell.php
and in the rangeBoundaries()
method, on or around line 715 (depending on the exact release/build you're running), look for
// Uppercase coordinate
$pRange = strtoupper($pRange);
and try changing it to:
// Uppercase coordinate
$pRange = strtoupper(str_replace('$', '', $pRange));