[]
Returns the IName object from a collection.
Use this indexer to retrieve a defined name by its name.
IName this[string name] { get; }
ReadOnly Default Property Item(name As String) As IName
| Type | Name | Description |
|---|---|---|
| string | name | Specifies the name of an element in the collection. |
| Type | Description |
|---|---|
| IName | Returns IName. |
INames names = workbook.Names;
names.Add("SalesRange", "=Sheet1!$A$1:$A$5");
IName name = names["SalesRange"];
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.
IName this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As IName
| Type | Name | Description |
|---|---|---|
| int | index | Specifies the index of an element in the collection. |
| Type | Description |
|---|---|
| IName | Returns IName |
INames names = workbook.Names;
names.Add("SalesRange", "=Sheet1!$A$1:$A$5");
IName name = names[0];
string definedName = name.Name;