NamedItem 资源类型NamedItem resource type

表示单元格区域或值的定义名称。名称可以为基元的已命名对象(如以下类型中所示)、range 对象或对区域的引用。此对象可用于获取与名称相关的 range 对象。Represents a defined name for a range of cells or value. Names can be primitive named objects (as seen in the type below), range object, reference to a range. This object can be used to obtain range object associated with names.


方法Method 返回类型Return Type 说明Description
AddAdd WorkbookNamedItemWorkbookNamedItem 将新名称添加到给定范围的集合。Adds a new name to the collection of the given scope.
AddFormulaLocalAddFormulaLocal WorkbookNamedItemWorkbookNamedItem 使用用户的公式区域设置,将新名称添加到给定范围的集合。Adds a new name to the collection of the given scope using the user's locale for the formula.
获取 NamedItemGet NamedItem WorkbookNamedItemWorkbookNamedItem 读取 nameditem 对象的属性和关系。Read properties and relationships of namedItem object.
更新Update WorkbookNamedItemWorkbookNamedItem 更新 NamedItem 对象。Update NamedItem object.
区域Range 区域Range 返回与名称相关的 range 对象。如果已命名项目的类型不是区域,将引发异常。Returns the range object that is associated with the name. Throws an exception if the named item's type is not a range.
列出List WorkbookNamedItem 集合WorkbookNamedItem collection 获取 namedItem 对象集合。Get namedItem object collection.


属性Property 类型Type 说明Description
namename stringstring 对象的名称。只读。The name of the object. Read-only.
注释comment stringstring 表示与此名称相关联的注释。Represents the comment associated with this name.
scopescope stringstring 指明是否将 name 限定到工作簿或特定工作表。只读。Indicates whether the name is scoped to the workbook or to a specific worksheet. Read-only.
类型type 字符串string 指示与名称相关的引用类型。Indicates what type of reference is associated with the name. 可能的值包括 StringIntegerDoubleBooleanRangeThe possible values are: String, Integer, Double, Boolean, Range. 只读。Read-only.
valuevalue JsonJson 表示名称定义为引用的公式。例如 =Sheet14!$B$2:$H$12、=4.75 等。只读。Represents the formula that the name is defined to refer to. E.g. =Sheet14!$B$2:$H$12, =4.75, etc. Read-only.
visiblevisible 布尔boolean 指定对象是否可见。Specifies whether the object is visible or not.


关系Relationship 类型Type 说明Description
worksheetworksheet WorkbookWorksheetWorkbookWorksheet 返回已命名项限定到的工作表。仅在该项目的作用域为工作表时才可用。只读。Returns the worksheet on which the named item is scoped to. Available only if the item is scoped to the worksheet. Read-only.

JSON 表示形式JSON representation

下面是资源的 JSON 表示形式。Here is a JSON representation of the resource.

  "name": "string",
  "comment": "string",
  "scope": "string",
  "type": "string",
  "value": {"@odata.type": "microsoft.graph.Json"},
  "visible": true