[Bug]: Named Expressions don't update when adding rows
Description
When adding rows using hf.AddRows( ) any formulae that are affected are automatically updated, matching the behaviour of Excel.
However any named expressions are not updated, meaning the ranges they point to are now incorrect.
Full reproduction in stackblitz link below
Video or screenshots
Demo
https://stackblitz.com/edit/node-sfv4nvjp?file=index.ts
HyperFormula version
3.0.0
Your framework
Node
Your environment
N/A
Hi @grahamorrell, thanks for reaching out.
I verified that Microsoft Excel updates the named expression when a row is added in the middle of the referenced range. In that case, it must be considered a HyperFormula bug. I'm adding it to our backlog.
@grahamorrell, I analyzed your demo again and found that the way you defined a named expression was a bit off.
hf.addNamedExpression('testName', 'Sheet1!A1:A2');
This definition lacks the equals sign (=), so it is not a formula that refers to a range but a plain string value "Sheet1!A1:A2".
The correct definition of a named expression that refers to a range would look like this:
hf.addNamedExpression('testName', '=Sheet1!$A$1:$A$2');
When I changed it in your demo, it works as expected: https://stackblitz.com/edit/node-kpsf83i8?file=index.ts
I'm sorry I didn't spot it when I first looked at this issue.