Posted 11 January 2024, 9:59 pm EST
Hi,
The getRow and getColumn methods in the NameInfo object return the base row and base column, respectively. The base row and column are used when relative cell references are used in an expression.
For example, if you have defined a custom name using sheet.addCustomName(“customName”, “=b2”, 0, 0) where the base row and column are both set to 0. When you use this custom name in cell C3, it will refer to cell d4 not b2. This is because B2 was 1 cell away from both the base row and column, so when you apply the custom name in cell C3, the formula becomes “=d4” (1 cell away from C3 both row-wise and column-wise).
In your case, the reason getColumn() is returning zero because base column was set to zero at the time of defining the custom name.
References:
getRow: https://developer.mescius.com/spreadjs/api/classes/GC.Spread.Sheets.NameInfo#getrow
getColumn: https://developer.mescius.com/spreadjs/api/classes/GC.Spread.Sheets.NameInfo#getcolumn
Cell References:
https://developer.mescius.com/spreadjs/docs/formulareference/formulaoverview/cellreferences
Best regards,
Ankit