PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.2k forks source link

addNamedRange with constant value (and no associated cell) #1367

Open FGIKCM opened 6 years ago

FGIKCM commented 6 years ago

Hello,

Trying to create an Excel NamedRange with "fixed value" (for example, "=0" instead of "=A1"), I get error message:

Invalid cell coordinate 0

For example:

$this->phpExcel->addNamedRange(
    new PHPExcel_NamedRange('MY_CONSTANT', $sheet1, '=0')    # Also tried : '0', 0
);

In Workshop::_writeDefinedNameForNamedRange(), you check for valid cells coordinates (and it is great). But you can also have "direct values". This can be tested in Excel:

Best regards,