Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Set-OfficeExcelFreeze

Aliases: ExcelFreeze
Namespace PSWriteOffice
Aliases
ExcelFreeze
Inputs
OfficeIMO.Excel.ExcelDocument

Freezes panes on the current worksheet.

Remarks

Freezes panes on the current worksheet.

Examples

Authored help example

Freeze the top row.

PS>


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

Freezes the first row.

Freeze the top row and first column.

PS>


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

Freezes row 1 and column A.

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.

Syntax

Set-OfficeExcelFreeze [-LeftColumns <Int32>] [-PassThru] [-TopRows <Int32>] [<CommonParameters>]
#
Parameter set: Context

Parameters

LeftColumns Int32 optionalposition: namedpipeline: False
Number of columns to freeze from the left.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.
TopRows Int32 optionalposition: namedpipeline: False
Number of rows to freeze from the top.
Set-OfficeExcelFreeze -Document <ExcelDocument> [-LeftColumns <Int32>] [-PassThru] [-Sheet <String>] [-SheetIndex <Int32>] [-TopRows <Int32>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
LeftColumns Int32 optionalposition: namedpipeline: False
Number of columns to freeze from the left.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.
Sheet String optionalposition: namedpipeline: False
Worksheet name when using Document.
SheetIndex Int32 optionalposition: namedpipeline: False
Worksheet index (0-based) when using Document.
TopRows Int32 optionalposition: namedpipeline: False
Number of rows to freeze from the top.