NativeExcel2 for .Net Developer's Reference

INames.Item Property (String)

Returns a single IName interface from a Names collection using defined name.

[C#] In C#, this property is the indexer for the INames class.

[Visual Basic]
DefaultPropertyReadOnlyItem(_
ByValNameAsString_
)AsIName
[C#]
INamethis[
stringName
]{get;}
[C++]
__propertyIName*get_Item(
String*Name
);
[JScript]
returnValue = INamesObject.Item( Name );
-or-
returnValue = INamesObject( Name );

[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.

Parameters

Name
The defined name of the IName interface.

Property Value

IName interface.

Example

This example returns the defined name 'MyName' of the worksheet one.

[C#]
IName name;
name = Workbook.Worksheets[1].Names["MyName"];   
[VisualBasic]
Dim name As IName
name = Workbook.Worksheets(1).Names("MyName")
[C++]
IName* name;
name = Workbook->Worksheets->Item[1]->Names->Item[S"MyName"];   

See Also

INames Interface | NativeExcel Namespace | INames.Item Overload List | IWorksheet.Names property | IWorkbook.Names property | IName interface | IName.Name property