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

Sets or returns the worksheet's viewing mode.

Signature
C#
C#
 public SheetViewState ViewState{ get; set; }
Signature
vb.net
vb.net
Public Property ViewState() As SheetViewState
Example
Code Block
csharp
csharp
titleC#
//--- Get ViewState
Worksheet.SheetViewState state = ws.ViewState;

//--- Set ViewState
ws.ViewState = Worksheet.SheetViewState.PageBreak;
Code Block
vb.net
vb.net
titlevb.net
'--- Get ViewState
Dim state As Worksheet.SheetViewState = ws.ViewState

'--- Set ViewState
ws.ViewState = Worksheet.SheetViewState.PageBreak
Exceptions
Exception
ArgumentException
ArgumentException

Attempting to set ViewState to PageLayout in an Excel 2003 or earlier workbook will throw an ArgumentException.

Remarks

The viewing mode may be any of the values defined by SheetViewState. By default, worksheets are in Normal mode.

Note that only Excel 2007 or later workbooks support PageLayout mode.

Setting this property to null will set the mode to Normal.