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
This commit is contained in:
parent
f2076cde3f
commit
6e7b84ef97
|
@ -283,6 +283,10 @@ class PHPExcel_Cell
|
||||||
$result = PHPExcel_Calculation::getInstance()->calculateCellValue($this,$resetLog);
|
$result = PHPExcel_Calculation::getInstance()->calculateCellValue($this,$resetLog);
|
||||||
// echo $this->getCoordinate().' calculation result is '.$result.'<br />';
|
// echo $this->getCoordinate().' calculation result is '.$result.'<br />';
|
||||||
} catch ( Exception $ex ) {
|
} 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().'<br />';
|
||||||
|
return $this->_calculatedValue; // Fallback for calculations referencing external files.
|
||||||
|
}
|
||||||
// echo 'Calculation Exception: '.$ex->getMessage().'<br />';
|
// echo 'Calculation Exception: '.$ex->getMessage().'<br />';
|
||||||
$result = '#N/A';
|
$result = '#N/A';
|
||||||
throw(new Exception($this->getParent()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage()));
|
throw(new Exception($this->getParent()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage()));
|
||||||
|
|
Loading…
Reference in New Issue