Apr 25, 2013 at 3:09 AM
Edited Apr 25, 2013 at 3:10 AM
Just for example, I have a sheet named "1" and a sheet named "2". In worksheet "2" there is a cell whose contents are the formula "='1'!F4".
$sheetData = $objPHPExcel->getActiveSheet()->getCell('F4')->getValue();
produces the following output:
In addition, when I tried to load an entire sheet with
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
it initially gave me a Cyclical check, but then when I threw the following line into my code
PHPExcel_Calculation::getInstance()->cyclicFormulaCount = 1;
It would give me the following error (note, this is referring to worksheet '2' cell A2):
PHP Fatal error: Uncaught exception 'PHPExcel_Exception' with message '2!A2 -> undefined variable '!'' in /var/www/Classes/PHPExcel/Cell.php:307
#0 /var/www/Classes/PHPExcel/Worksheet.php(2415): PHPExcel_Cell->getCalculatedValue()
#1 /var/www/Classes/PHPExcel/Worksheet.php(2486): PHPExcel_Worksheet->rangeToArray('A1:AN180', NULL, true, true, true)
#2 /var/www/index.php(29): PHPExcel_Worksheet->toArray(NULL, true, true, true)
thrown in /var/www/Classes/PHPExcel/Cell.php on line 307
I'll add that I don't know what passing NULL, true, true, true to toArray does, but this same type of error (or correct functionality that I'm using incorrectly) occurs elsewhere, too.
As it stands, I have standardized spreadsheets so I can manually trace every reference and set the active sheet and cell and get the value, but.... that's a LOT of work when we have hundreds of cells referencing cells in other sheets that reference cells in
other sheets that.....
Any help would be appreciated.