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.

 public sealed class NamedObject
Public NotInheritable Class NamedObject

The following sample gets a NamedObject from a Workbook.

          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Open(@"C:\MySpreadsheet.xls");
          NamedObject namedObj = wb.GetNamedObject("MyNamedObject");
          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.Open("C:\MySpreadsheet.xls")
          Dim namedObj As NamedObject = wb.GetNamedObject("MyNamedObject")

Name

Description

Formula

Name

NamedObjectType

NameScope

Value

Name

Description

BuiltInName

ReturnType

Scope

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.