# Set-OfficeExcelFreeze

Freezes panes on the current worksheet. 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: ExcelFreeze

**Module**

`PSWriteOffice`

**Aliases**

`ExcelFreeze`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Source**

[SetOfficeExcelFreezeCommand.cs:22](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/SetOfficeExcelFreezeCommand.cs#L22) 

Freezes panes on the current worksheet.

## Syntax

```
Set-OfficeExcelFreeze
[-LeftColumns <Int32>]
[-PassThru]
[-TopRows <Int32>]
[<CommonParameters>]
```

[#](#method-set-officeexcelfreeze-int32-switchparameter-int32)

Parameter set: `Context`

```
Set-OfficeExcelFreeze
-Document <ExcelDocument>
[-LeftColumns <Int32>]
[-PassThru]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-TopRows <Int32>]
[<CommonParameters>]
```

[#](#method-set-officeexcelfreeze-exceldocument-int32-switchparameter-string-int32-int32)

Parameter set: `Document`

## Examples

### Freeze the top row.

```powershell
ExcelSheet 'Data' { Set-OfficeExcelFreeze -TopRows 1 }
```

Freezes the first row.

### Freeze the top row and first column.

```powershell
ExcelSheet 'Data' { Set-OfficeExcelFreeze -TopRows 1 -LeftColumns 1 }
```

Freezes row 1 and column A.

## Parameters

**-LeftColumns Int32 optional**

Number of columns to freeze from the left.

**-PassThru SwitchParameter optional**

Emit the object created or changed by the command.

**-TopRows Int32 optional**

Number of rows to freeze from the top.

**-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:CCCD2D8564B1AB2C7B4EB851A28407FE05670E70E6FC1DC85485739194539275 -->
