Browser backarrow errors

Topics: User Forum
Jul 14, 2011 at 5:51 PM

Using the:

$objReader = PHPExcel_IOFactory::createReader('Excell2007');

I can successfully read in my spreadsheet that was previously uploaded and access values in it- everything works fine.

When the user navigates away from the page then uses the browser back arrow to get back to the page that loads the spread sheet the script dies with a:

Fatal error: Call to a member function getCellByColumnAndRow() on a non-object:

On this line:

$cell_value=$objPHPExcel->getActiveSheet()->getCellByColumnAndRow($c, $r)->getValue();

I just want to be able to deal with the error to redirect them to the appropriate page to reload the spreadsheet. I have tried wrapping the above line in a try/catch block but this still generates a fatal error.