Persisting a spreadsheet on the Session

Topics: Developer Forum
Nov 6, 2009 at 9:30 AM
Edited Nov 6, 2009 at 9:36 AM

Trying to persist a spreadsheet on the Session:-



$objPHPExcel = new PHPExcel();

if (!isset($_SESSION['objPHPExcel'])) {
	$objPHPExcel = PHPExcel_IOFactory::load("myfile.xlsx");
} else {
	$objPHPExcel = (Object) $_SESSION['objPHPExcel'];

$_SESSION['objPHPExcel'] = $objPHPExcel;



This works like a treat when reading from the file but when POST-ing back and attempting to update the value in a cell:-


$objPHPExcel->getActiveSheet()->setCellValue('F6', '100');


The following error is seen:-

Fatal error: Call to a member function bindValue() on a non-object in ...\Classes\PHPExcel\Cell.php on line 217

Am I missing something?


Versions: PHP 5.2.11 & PHPExcel 1.7.1

Nov 7, 2009 at 12:05 AM

Work item created:

Download latest source code from here tomorrow:

Nov 9, 2009 at 8:16 AM

Thanks for the reply. As a workaround I found this to work:

$objPHPExcel->getActiveSheet()->setCellValueExplicit('F6', $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);