Skip to content
This repository was archived by the owner on Jan 2, 2019. It is now read-only.

Changing sheet title containing single quote doesn't update all formulas referencing that sheet #196

Open
@jmitchell-bf

Description

@jmitchell-bf

If I have a sheet title with a quote mark in it - for example, Sheet 'Q - and a cell (let's say B1) with a formula in it that references that sheet title:
SUM('Sheet ''Q'!A1:A5)

Then calling $worksheet->setTitle("NewName") leaves formulas with references to the old sheet name (Sheet 'Q) in them.

This seems to be a result of the comparison in the updateNamedFormulas function in ReferenceHelper.php. $oldName contains a version of the formula without the extra ' character, whereas $formula (which is populated by calling $cell->getValue()) does have that escaped version in it. As a result, they do not match even though they should, and the formula doesn't get updated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions