only what is visible FROM that sheet — the global items (tables included) plus that sheet's own, shadowing resolved
The two exist because the two consumers genuinely differ: a name manager lists everything that
exists, while a formula editor may only offer what a formula written here can actually refer to.
Both get it from getItems() with no arguments, which is the point — the scope question is
answered by the call you make, so it cannot be got wrong by omitting an option.
Scope is visibility, never location. A defined name lives on no sheet and may be visible
everywhere or on exactly one sheet. A table lives ON a sheet but its name is always visible
everywhere and workbook-unique — so getScope() is null for every table, and tables appear in
BOTH collections. That is not a special case: they are globally visible, so they turn up wherever
globally visible items do. For the tables anchored to one sheet, ask ISheet.getTables() — that is
the location question, and it has its own call.
Porting from Excel's Office Scripts. Deliberately close but not identical. There,
Workbook.getNames() is global-scoped names ONLY and Worksheet.getNames() is that sheet's own
ONLY, with tables kept out of names entirely. Both of ours are supersets of their counterpart, so a
direct port is over-inclusive rather than wrong — it will never see another sheet's private names.
Filter on INamed.getScope (null = global) for exact parity.
A collection of
INameditems — defined names AND tables.Remarks
Which items it holds is decided by where you got it from, not by an option. There is no scope argument anywhere on this interface:
The two exist because the two consumers genuinely differ: a name manager lists everything that exists, while a formula editor may only offer what a formula written here can actually refer to. Both get it from
getItems()with no arguments, which is the point — the scope question is answered by the call you make, so it cannot be got wrong by omitting an option.Scope is visibility, never location. A defined name lives on no sheet and may be visible everywhere or on exactly one sheet. A table lives ON a sheet but its name is always visible everywhere and workbook-unique — so
getScope()isnullfor every table, and tables appear in BOTH collections. That is not a special case: they are globally visible, so they turn up wherever globally visible items do. For the tables anchored to one sheet, askISheet.getTables()— that is the location question, and it has its own call.Porting from Excel's Office Scripts. Deliberately close but not identical. There,
Workbook.getNames()is global-scoped names ONLY andWorksheet.getNames()is that sheet's own ONLY, with tables kept out of names entirely. Both of ours are supersets of their counterpart, so a direct port is over-inclusive rather than wrong — it will never see another sheet's private names. Filter on INamed.getScope (null= global) for exact parity.See
Interface
INamedCollection