Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Description

Excerpt

Set the sheets that will be selected when the workbook is opened in Excel.

Signature
C#
C#
 public void Select(System.Object[] sheets)
{signature}{signature:
}
Signature
vb.net
vb.net
Public Sub [Select](ByVal sheets As Object())
{signature}
{parameters}
{param:sheets}Array of sheet indexes or sheet names.{param}
{exceptions}
{exception:ArgumentException}If an item in the array is not of type int or string; or if it does not correspond to a worksheet 
Parameters
Param
sheets
sheets

Array of sheet indexes or sheet names.

Exceptions
Exception
ArgumentException
ArgumentException

If an item in the array is not of type int or string; or if it does not correspond to a worksheet (i.e.

specifies

a

name

for

a

worksheet

that

does

not

exist,

or

an

index

that

does

not

correspond

to

an

existing

worksheet

position)

{exception} {remarks} Each object in the array should be an int or a string. If it is an int, the worksheet at the specified position will be selected. If it is a string, the worksheet with the specified name will be selected. If the array is empty, there will be no effect. The worksheets that were previously selected will still be selected. The last object in the array specifies the worksheet that will be visible when first opened in Excel. The other parameters specify the worksheets that will be selected, but will not be displayed in the main Excel window when you first open the file. {remarks} {example}{code:csharp|title=C#}

Remarks

Each object in the array should be an int or a string. If it is an int, the worksheet at the specified position will be selected. If it is a string, the worksheet with the specified name will be selected.

If the array is empty, there will be no effect. The worksheets that were previously selected will still be selected.

The last object in the array specifies the worksheet that will be visible when first opened in Excel. The other parameters specify the worksheets that will be selected, but will not be displayed in the main Excel window when you first open the file.

Example
Code Block
csharp
csharp
titleC#

sheets.Select(arrSheets);
{code} {code:
Code Block
vb.net
|title=
vb.net
titlevb.net
}

sheets.Select(arrSheets)
{code} {example}