# Set-OfficeExcelPrintLayout

Applies a reusable worksheet print layout preset. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

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: ExcelPrintLayout

**Module**

`PSWriteOffice`

**Aliases**

`ExcelPrintLayout`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Outputs**

`OfficeIMO.Excel.ExcelSheet` `System.Management.Automation.PSObject`

**Source**

[SetOfficeExcelPrintLayoutCommand.cs:19](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/SetOfficeExcelPrintLayoutCommand.cs#L19) 

Applies a reusable worksheet print layout preset.

## Syntax

```
Set-OfficeExcelPrintLayout
[-FitToHeight <UInt32>]
[-FitToWidth <UInt32>]
[-Margins <Normal|Narrow|Moderate|Wide>]
[-NoPresetPrintTitles]
[-Orientation <Portrait|Landscape>]
[-PageOrder <DownThenOver|OverThenDown>]
[-PassThru]
[-Preset <Worksheet|Report|Dashboard|DataTable>]
[-PrintArea <String>]
[-RepeatFirstColumn <Int32>]
[-RepeatFirstRow <Int32>]
[-RepeatLastColumn <Int32>]
[-RepeatLastRow <Int32>]
[-Scale <UInt32>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]
```

[#](#member-dd103701799b7741e7e46e03)

Parameter set: `Context`

```
Set-OfficeExcelPrintLayout
[-FitToHeight <UInt32>]
[-FitToWidth <UInt32>]
[-Margins <Normal|Narrow|Moderate|Wide>]
[-NoPresetPrintTitles]
[-Orientation <Portrait|Landscape>]
[-PageOrder <DownThenOver|OverThenDown>]
[-PassThru]
[-Path] <String>
[-Preset <Worksheet|Report|Dashboard|DataTable>]
[-PrintArea <String>]
[-RepeatFirstColumn <Int32>]
[-RepeatFirstRow <Int32>]
[-RepeatLastColumn <Int32>]
[-RepeatLastRow <Int32>]
[-Scale <UInt32>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]
```

[#](#member-919f5fa3b491614a51963234)

Parameter set: `Path`

```
Set-OfficeExcelPrintLayout
-Document <ExcelDocument>
[-FitToHeight <UInt32>]
[-FitToWidth <UInt32>]
[-Margins <Normal|Narrow|Moderate|Wide>]
[-NoPresetPrintTitles]
[-Orientation <Portrait|Landscape>]
[-PageOrder <DownThenOver|OverThenDown>]
[-PassThru]
[-Preset <Worksheet|Report|Dashboard|DataTable>]
[-PrintArea <String>]
[-RepeatFirstColumn <Int32>]
[-RepeatFirstRow <Int32>]
[-RepeatLastColumn <Int32>]
[-RepeatLastRow <Int32>]
[-Scale <UInt32>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]
```

[#](#member-c7405d24f726f2d08c98b054)

Parameter set: `Document`

## Examples

### Apply a report print layout.

```powershell
ExcelSheet 'Report' { Set-OfficeExcelPrintLayout -Preset Report -PrintArea A1:H40 }
```

Applies landscape orientation, narrow margins, one-page-wide scaling, and repeated header row.

## Parameters

**-FitToHeight UInt32 optional**

Optional pages-tall fit override. Use 0 for unlimited height.

**-FitToWidth UInt32 optional**

Optional pages-wide fit override.

**-Margins ExcelMarginPreset optional**

Optional margin preset override.

Possible values: `Normal`, `Narrow`, `Moderate`, `Wide`

**-NoPresetPrintTitles SwitchParameter optional**

Do not apply print-title rows from the selected preset.

**-Orientation OfficePageOrientation optional**

Optional orientation override.

Possible values: `Portrait`, `Landscape`

**-PageOrder ExcelPageOrder optional**

Optional multi-page print order override.

Possible values: `DownThenOver`, `OverThenDown`

**-PassThru SwitchParameter optional**

Emit the worksheet after applying the layout.

**-Preset ExcelPrintLayoutPreset optional**

Print layout preset.

Possible values: `Worksheet`, `Report`, `Dashboard`, `DataTable`

**-PrintArea String optional**

Optional print area in A1 notation.

**-RepeatFirstColumn Int32 optional**

Optional first 1-based repeated print-title column.

**-RepeatFirstRow Int32 optional**

Optional first 1-based repeated print-title row.

**-RepeatLastColumn Int32 optional**

Optional last 1-based repeated print-title column.

**-RepeatLastRow Int32 optional**

Optional last 1-based repeated print-title row.

**-Scale UInt32 optional**

Optional manual scale percentage override.

**-Sheet String optionalaliases: WorksheetName**

Worksheet name. Defaults to the current sheet inside an ExcelSheet block.

**-SheetIndex Int32 optional**

Worksheet index when using a workbook object or path.

**-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path**

Workbook path to update.

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

Workbook to update outside the DSL context.

## 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:5B087FFFA8307604FCC26A404C4238BAA3169D7DB33D2CCC95F77A4C9CE7FDB6 -->
