Version

SelectedWorksheet Property

Gets or sets the selected worksheet of the workbook.
Syntax
'Declaration
 
Public Property SelectedWorksheet As Worksheet
public Worksheet SelectedWorksheet {get; set;}

Property Value

The selected worksheet of the workbook.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionThe assigned value is null and this is an instance of WorkbookWindowOptions whose associated Workbook has at least one Worksheet.
System.ArgumentExceptionThe assigned value does not belong to the workbook associated with this instance of WindowOptions.
Remarks

If this is an instance of CustomViewWindowOptions and the SelectedWorksheet value is null, the workbook's selected worksheet will not be changed when the associated CustomView is applied.

Note: If the selected worksheet does not have its DisplayOptionsBase.Visibility set to Visible when the workbook is saved, another worksheet will be selected.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also