API Reference

Cmdlet

Set-OfficeExcelPrintTitles

Aliases: ExcelPrintTitles
Namespace PSWriteOffice
Aliases
ExcelPrintTitles
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Object

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

Remarks

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

Examples

Authored help example

Repeat report headers on every printed page.

PS>


$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.

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-OfficeExcelPrintTitles [-Clear] [-FirstColumn <Nullable`1>] [-FirstRow <Nullable`1>] [-LastColumn <Nullable`1>] [-LastRow <Nullable`1>] [-PassThru] [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]
#
Parameter set: Context

Parameters

Clear SwitchParameter optionalposition: namedpipeline: False
Clear existing print titles for the worksheet.
FirstColumn Nullable`1 optionalposition: namedpipeline: False
First 1-based column to repeat.
FirstRow Nullable`1 optionalposition: namedpipeline: False
First 1-based row to repeat.
LastColumn Nullable`1 optionalposition: namedpipeline: False
Last 1-based column to repeat.
LastRow Nullable`1 optionalposition: namedpipeline: False
Last 1-based row to repeat.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after setting print titles.
Sheet String optionalposition: namedpipeline: Falsealiases: WorksheetName
Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index when using a workbook object or path.

Outputs

System.Object

Set-OfficeExcelPrintTitles [-Clear] [-FirstColumn <Nullable`1>] [-FirstRow <Nullable`1>] -InputPath <String> [-LastColumn <Nullable`1>] [-LastRow <Nullable`1>] [-PassThru] [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]
#
Parameter set: Path

Parameters

Clear SwitchParameter optionalposition: namedpipeline: False
Clear existing print titles for the worksheet.
FirstColumn Nullable`1 optionalposition: namedpipeline: False
First 1-based column to repeat.
FirstRow Nullable`1 optionalposition: namedpipeline: False
First 1-based row to repeat.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to update.
LastColumn Nullable`1 optionalposition: namedpipeline: False
Last 1-based column to repeat.
LastRow Nullable`1 optionalposition: namedpipeline: False
Last 1-based row to repeat.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after setting print titles.
Sheet String optionalposition: namedpipeline: Falsealiases: WorksheetName
Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index when using a workbook object or path.

Outputs

System.Object

Set-OfficeExcelPrintTitles [-Clear] -Document <ExcelDocument> [-FirstColumn <Nullable`1>] [-FirstRow <Nullable`1>] [-LastColumn <Nullable`1>] [-LastRow <Nullable`1>] [-PassThru] [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Clear SwitchParameter optionalposition: namedpipeline: False
Clear existing print titles for the worksheet.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to update outside the DSL context.
FirstColumn Nullable`1 optionalposition: namedpipeline: False
First 1-based column to repeat.
FirstRow Nullable`1 optionalposition: namedpipeline: False
First 1-based row to repeat.
LastColumn Nullable`1 optionalposition: namedpipeline: False
Last 1-based column to repeat.
LastRow Nullable`1 optionalposition: namedpipeline: False
Last 1-based row to repeat.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after setting print titles.
Sheet String optionalposition: namedpipeline: Falsealiases: WorksheetName
Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index when using a workbook object or path.

Outputs

System.Object