Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

...

Wiki Markup
{description}
{excerpt}Sets or returns the worksheet's viewing mode.

...

{signature}
{example}{code:csharp|title=C#}
//--- Get ViewState
Worksheet.SheetViewState state = ws.ViewState;

//--- Set ViewState
ws.ViewState = Worksheet.SheetViewState.PageBreak;
{code}
{code:vb.net
|title=vb.net
}
'--- Get ViewState
Dim state As Worksheet.SheetViewState = ws.ViewState

'--- Set ViewState
ws.ViewState = Worksheet.SheetViewState.PageBreak
Signature
C#C#
{excerpt}
{signature:C#}
 public SheetViewState ViewState{ get; set; }
Signature
{signature}{signature:vb.net
vb.net
}
Public Property ViewState() As SheetViewState
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle
Exceptions
Exception
ArgumentExceptionArgumentException

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.
{code}

{example}
{exceptions}
{exception:ArgumentException}
Attempting to set {{ViewState}} to {{PageLayout}} in an Excel 2003 or earlier workbook will throw an {{ArgumentException}}.
{exception}
{remarks}
The viewing mode may be any of the values defined by [{{SheetViewState}}|Worksheet.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}}.
{remarks}