NativeExcel for .Net Developer's Reference

IWorksheets.Item Property (String)

Returns an IWorksheet by using sheet name.

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

[Visual Basic]
Default Property ReadOnly Item( _ 
   ByVal Name As String _ 
) As IWorksheet
[C#]
IWorksheet this[
   string Name
] { get; }
[C++]
__property IWorksheet* get_Item(
   String* Name
);
[JScript]
returnValue = IWorksheetsObject.Item( Name );
-or-
returnValue = IWorksheetsObject( 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
A string that indicates the name of the worksheet you want to access.

Property Value

Returns an IWorksheet interface.

Example

This example activates the worksheet with name "Orders"

[C#]
book.Worksheets["Orders"].Activate();
[Visual Basic]
book.Worksheets("Orders").Activate()
[C++]
book->Worksheets->Item[S"Orders"]->Activate();

See Also

IWorksheets Interface | NativeExcel Namespace | IWorksheets.Item Overload List