From 6e7b84ef97133be271184e50234cb0ceda804882 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Fri, 25 Nov 2011 14:30:02 +0000 Subject: [PATCH] Bugfix: Work item 16956 - External links in Excel2010 files cause Fatal error git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@83262 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Cell.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Classes/PHPExcel/Cell.php b/Classes/PHPExcel/Cell.php index 7a05ab36..93ebb72a 100644 --- a/Classes/PHPExcel/Cell.php +++ b/Classes/PHPExcel/Cell.php @@ -283,6 +283,10 @@ class PHPExcel_Cell $result = PHPExcel_Calculation::getInstance()->calculateCellValue($this,$resetLog); // echo $this->getCoordinate().' calculation result is '.$result.'
'; } catch ( Exception $ex ) { + if (($ex->getMessage() === 'Unable to access External Workbook') && (!is_null($this->_calculatedValue))) { +// echo 'Returning fallback value of '.$this->_calculatedValue.' for cell '.$this->getCoordinate().'
'; + return $this->_calculatedValue; // Fallback for calculations referencing external files. + } // echo 'Calculation Exception: '.$ex->getMessage().'
'; $result = '#N/A'; throw(new Exception($this->getParent()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage()));