Closed Dfred closed 7 years ago
Could you provide a Minimal, Complete, and Verifiable example of code that exhibits this issue without the use of external file please ?
Is this good enough?
$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0);
$objPHPExcel->getActiveSheet()->setCellValue('A1', 'kiki');
$objPHPExcel->addNamedRange( new PHPExcel_NamedRange(html_entity_decode('cliché'), $objPHPExcel->getActiveSheet(), 'A1'));
PHPExcel_Calculation::getInstance($objPHPExcel)->parseFormula(html_entity_decode('=cliché'));
thanks ! I can reproduce it even in PhpSpreadsheet:
require __DIR__ . '/vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\NamedRange;
use PhpOffice\PhpSpreadsheet\Calculation;
$objPHPExcel = new Spreadsheet();
$objPHPExcel->getActiveSheet()->setCellValue('A1', 'kiki');
$name = html_entity_decode('cliché');
$objPHPExcel->addNamedRange(new NamedRange($name, $objPHPExcel->getActiveSheet(), 'A1'));
$res = Calculation::getInstance($objPHPExcel)->parseFormula('=' . $name);
var_dump($res);
Good job with PhpSpreadsheet by the way, any release date in sight?
@PowerKiKi Did you file a bug report on PhpSpreadsheet as well? If so, can you provide a link ?
No, I didn't file an issue on PhpSpreadsheet. I wish we could move issue across projects...
A beta release is planned "soon"...
I copied this bug-report to PhpSpreadsheet, see it there: https://github.com/PHPOffice/PhpSpreadsheet/issues/179
Closing here
As confirmed by @MarkBaker, _PHPExcelCalculation::parseFormula() should handle multibyte named ranges. However the following call fails (cliché is a named range):
PHPExcel_Calculation::getInstance()->parseFormula('=cliché');
It throws a
PHPExcel_Calculation_Exception
with message