I'm trying to append rows to an existing spreadsheet. I can open the existing sheet and find its dimensions - and therefore the last row - using this:
$findDimensions = $objPHPExcel2->getActiveSheet()->calculateWorksheetDimension();
I have the new data in a two-dimensional PHP array $newData, but when I try to append using:
$objPHPExcel2->getActiveSheet->fromArray($newData, null, 'A'.$appendStartRow);
...where $appendStartRow is 2 or greater, I get this:
Notice: Undefined property: PHPExcel::$getActiveSheet in C:\PHP\test.php on line 200
Fatal error: Call to a member function fromArray() on null in C:\PHP\test.php on line 200
I don't understand the cause of the error.
PHP Version: 5.6.12
PHPExcel: 1.8
Windows 7 64-bit
Chris.
$findDimensions = $objPHPExcel2->getActiveSheet()->calculateWorksheetDimension();
I have the new data in a two-dimensional PHP array $newData, but when I try to append using:
$objPHPExcel2->getActiveSheet->fromArray($newData, null, 'A'.$appendStartRow);
...where $appendStartRow is 2 or greater, I get this:
Notice: Undefined property: PHPExcel::$getActiveSheet in C:\PHP\test.php on line 200
Fatal error: Call to a member function fromArray() on null in C:\PHP\test.php on line 200
I don't understand the cause of the error.
PHP Version: 5.6.12
PHPExcel: 1.8
Windows 7 64-bit
Chris.