Better exception message for new Excel functions

Closes https://github.com/PHPOffice/PHPExcel/issues/1136
This commit is contained in:
Adrien Crivelli 2017-02-28 10:50:22 +09:00
parent 13472e8247
commit 0d1ff5b95f
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
1 changed files with 5 additions and 0 deletions

View File

@ -3764,6 +3764,11 @@ class Calculation
} elseif (preg_match('/^' . self::CALCULATION_REGEXP_NAMEDRANGE . '$/i', $token, $matches)) {
$namedRange = $matches[6];
$this->debugLog->writeDebugLog('Evaluating Named Range ', $namedRange);
if (substr($namedRange, 0, 6) === '_xlfn.') {
return $this->raiseFormulaError("undefined named range / function '$token'");
}
$cellValue = $this->extractNamedRange($namedRange, ((null !== $pCell) ? $pCellWorksheet : null), false);
$pCell->attach($pCellParent);
$this->debugLog->writeDebugLog('Evaluation Result for named range ', $namedRange, ' is ', $this->showTypeDetails($cellValue));