# Set-OfficeExcelPrintTitles

Sets or clears repeating print title rows and columns for a worksheet.

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 **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

Aliases: ExcelPrintTitles

**Module**

`PSWriteOffice`

**Aliases**

`ExcelPrintTitles`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Source**

[SetOfficeExcelPrintTitlesCommand.cs:21](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/SetOfficeExcelPrintTitlesCommand.cs#L21) 

Sets or clears repeating print title rows and columns for a worksheet.

## Syntax

```
Set-OfficeExcelPrintTitles
[-Clear]
[-FirstColumn <Int32>]
[-FirstRow <Int32>]
[-LastColumn <Int32>]
[-LastRow <Int32>]
[-PassThru]
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]
```

[#](#method-set-officeexcelprinttitles-switchparameter-int32-int32-int32-int32-switchparameter-string-int32)

Parameter set: `Context`

```
Set-OfficeExcelPrintTitles
[-Clear]
[-FirstColumn <Int32>]
[-FirstRow <Int32>]
[-LastColumn <Int32>]
[-LastRow <Int32>]
[-PassThru]
[-Path] <String>
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]
```

[#](#method-set-officeexcelprinttitles-switchparameter-int32-int32-int32-int32-switchparameter-string-string-int32)

Parameter set: `Path`

```
Set-OfficeExcelPrintTitles
[-Clear]
-Document <ExcelDocument>
[-FirstColumn <Int32>]
[-FirstRow <Int32>]
[-LastColumn <Int32>]
[-LastRow <Int32>]
[-PassThru]
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]
```

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

Parameter set: `Document`

## Examples

### Repeat report headers on every printed page.

```powershell
$proof = @(
    Set-OfficeExcelPrintTitles -Path .\Report.xlsx -Sheet Data -FirstRow 1 -LastRow 1 -FirstColumn 1 -LastColumn 1
    Get-OfficeExcelSummary -Path .\Report.xlsx |
        Select-Object -Property SheetCount, TableCount
)
$proof
```

Stores Excel print titles for the Data worksheet and then reads back workbook structure as a quick proof step.

## Parameters

**-Clear SwitchParameter optional**

Clear existing print titles for the worksheet.

**-FirstColumn Int32 optional**

First 1-based column to repeat.

**-FirstRow Int32 optional**

First 1-based row to repeat.

**-LastColumn Int32 optional**

Last 1-based column to repeat.

**-LastRow Int32 optional**

Last 1-based row to repeat.

**-PassThru SwitchParameter optional**

Emit the worksheet after setting print titles.

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