[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.INames.Item

this Property

this[string]

Returns the IName object from a collection.

Use this indexer to retrieve a defined name by its name.

Declaration
IName this[string name] { get; }
ReadOnly Default Property Item(name As String) As IName
Parameters
Type Name Description
string name

Specifies the name of an element in the collection.

Property Value
Type Description
IName

Returns IName.

Examples
INames names = workbook.Names;
names.Add("SalesRange", "=Sheet1!$A$1:$A$5");
IName name = names["SalesRange"];

this[int]

Returns the IName object from a collection.

Use the zero-based index of the defined name in this collection to retrieve a specific name object.

Declaration
IName this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As IName
Parameters
Type Name Description
int index

Specifies the index of an element in the collection.

Property Value
Type Description
IName

Returns IName

Examples
INames names = workbook.Names;
names.Add("SalesRange", "=Sheet1!$A$1:$A$5");
IName name = names[0];
string definedName = name.Name;