Posted 6 December 2017, 10:43 am EST
Hi!
I’m having an issue when I try create a custom name using refers like this “Sheet1!”. When I try get the expression of the custom name to get the value, that expression is undefined.
Note:
this.workbook = new GC.Spread.Sheets.Workbook(
document.getElementById(containerId),
spreadOptions
);
Steps to reproduce it:
- create a custom name
this.workbook.addCustomName(‘test1’, “‘Sheet1!’!$J$8”, 2, 2)
Result: it is working ok, I can see my custom name created over my spreadsheet.
- I want to get the value of that custom name, to do that I’m doing:
const customName = this.workbook.getCustomName(‘test1’);
if(customName) {
const expression = customName.getExpression();
const formula = GC.Spread.Sheets.CalcEngine.expressionToFormula(this.workbook, expression);
(…)
}
Result: the expression is undefined, and I’m only getting that error when I create custom names and the references has a sheet name with especial characters.
Do you have some work around to fix that?
Thanks in advance!
