# Set-OfficeExcelWorksheetView

Sets worksheet view options such as gridlines, direction, zoom, and view mode.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: ExcelSheetView

**Module**

`PSWriteOffice`

**Aliases**

`ExcelSheetView`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Source**

[SetOfficeExcelWorksheetViewCommand.cs:16](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/SetOfficeExcelWorksheetViewCommand.cs#L16) 

Sets worksheet view options such as gridlines, direction, zoom, and view mode.

## Syntax

```
Set-OfficeExcelWorksheetView
[-HideGridlines]
[-LeftToRight]
[-PassThru]
[-RightToLeft]
[-ShowGridlines]
[-View <Normal|PageBreakPreview|PageLayout>]
[-ZoomScale <UInt32>]
[-ZoomScaleNormal <UInt32>]
[<CommonParameters>]
```

[#](#method-set-officeexcelworksheetview-switchparameter-switchparameter-switchparameter-switchparameter-switchparameter-excelworksheetviewkind-uint32-uint32)

Parameter set: `Context`

```
Set-OfficeExcelWorksheetView
-Document <ExcelDocument>
[-HideGridlines]
[-LeftToRight]
[-PassThru]
[-RightToLeft]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-ShowGridlines]
[-View <Normal|PageBreakPreview|PageLayout>]
[-ZoomScale <UInt32>]
[-ZoomScaleNormal <UInt32>]
[<CommonParameters>]
```

[#](#method-set-officeexcelworksheetview-exceldocument-switchparameter-switchparameter-switchparameter-switchparameter-string-int32-switchparameter-excelworksheetviewkind-uint32-uint32)

Parameter set: `Document`

## Examples

### Apply common worksheet view options.

```powershell
ExcelSheet 'Data' { Set-OfficeExcelWorksheetView -HideGridlines -ZoomScale 125 -View PageLayout }
```

Hides gridlines, sets zoom, and switches the sheet view.

## Parameters

**-HideGridlines SwitchParameter optional**

Hide worksheet gridlines.

**-LeftToRight SwitchParameter optional**

Show worksheet left-to-right.

**-PassThru SwitchParameter optional**

Emit the worksheet after applying view options.

**-RightToLeft SwitchParameter optional**

Show worksheet right-to-left.

**-ShowGridlines SwitchParameter optional**

Show worksheet gridlines.

**-View ExcelWorksheetViewKind optional**

Worksheet view mode.

Possible values: `Normal`, `PageBreakPreview`, `PageLayout`

**-ZoomScale UInt32 optional**

Active worksheet zoom percentage. Excel supports values from 10 to 400.

**-ZoomScaleNormal UInt32 optional**

Normal-view worksheet zoom percentage. Excel supports values from 10 to 400.

**-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document**

Workbook to operate on outside the DSL context.

**-Sheet String optionalsets: Document**

Worksheet name when using Document.

**-SheetIndex Int32 optionalsets: Document**

Worksheet index (0-based) when using Document.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:635966EE6C63046610A1C57DBE8AD10AFD51F8E8A244F548CC2E078588FB884B -->
