Description
A NamedObject
object may refer to an array, number, picture, or range. To create a NamedObject
in an Excel file, use the corresponding method for the specific object you wish to create (Pictures.CreatePicture(), Workbook.CreateRange(), etc). To get a NamedObject
from an existing file, use Workbook.GetNamedObject(), passing in the name of the object you wish to get.
Examples
The following sample gets a NamedObject
from a Workbook.
Properties
Name |
Description |
---|---|
If the NamedObject refers to a named range, Formula returns the formula associated with the range, e.g. "=Sheet1!A1:G10". | |
Returns the name string that the specified NamedObject object represents. | |
Returns the type of object that the NamedObject refers to. | |
Returns the scope of the name, relative to the Excel workbook. | |
Returns the object referenced by this NamedObject. The object may be of any of the following types: Range, Picture, Array, Number. To determine the object type, use NamedObject.Type. |
Nested Classes
Name |
Description |
---|---|
The BuiltInName class contains all built-in object names. | |
A ReturnType value specifies the type of object a NamedObject refers to. | |
A Scope value specifies the scope of the object that a NamedObject refers to. |
Remarks
Named objects with type ReturnType.Range
can also be accessed (as Range
objects) through the Workbook.GetNamedRange
and Worksheet.GetNamedRange
methods. These objects will change their value like other ranges in response to adding or deleting rows, and other similar actions.
Named objects with type ReturnType.Formula
and ReturnType.ExternalReference
, though they may contain formulas with cell references, will not respond to such actions.