# Invoke-OfficeExcelTemplateRow

Repeats an Excel template row for pipeline data and replaces markers in each inserted row.

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: ExcelTemplateRow, ExcelTemplateRows

**Module**

`PSWriteOffice`

**Aliases**

`ExcelTemplateRow` `ExcelTemplateRows`

**Inputs**

`OfficeIMO.Excel.ExcelDocument` `System.Object`

**Outputs**

`System.Int32`

**Source**

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

Repeats an Excel template row for pipeline data and replaces markers in each inserted row.

## Syntax

```
Invoke-OfficeExcelTemplateRow
[-CultureName <String>]
[-InputObject] <Object>
[-MissingValueBehavior <PreserveMarker|EmptyString|Throw>]
[-PassThru]
[-Sheet <String>]
[-SheetIndex <Int32>]
-TemplateRow <Int32>
[-ThrowOnMissing]
[<CommonParameters>]
```

[#](#method-invoke-officeexceltemplaterow-string-object-exceltemplatemissingvaluebehavior-switchparameter-string-int32-int32-switchparameter)

Parameter set: `Context`

```
Invoke-OfficeExcelTemplateRow
[-CultureName <String>]
[-InputObject] <Object>
[-MissingValueBehavior <PreserveMarker|EmptyString|Throw>]
[-PassThru]
[-Path] <String>
[-Sheet <String>]
[-SheetIndex <Int32>]
-TemplateRow <Int32>
[-ThrowOnMissing]
[<CommonParameters>]
```

[#](#method-invoke-officeexceltemplaterow-string-object-exceltemplatemissingvaluebehavior-switchparameter-string-string-int32-int32-switchparameter)

Parameter set: `Path`

```
Invoke-OfficeExcelTemplateRow
[-CultureName <String>]
-Document <ExcelDocument>
[-InputObject] <Object>
[-MissingValueBehavior <PreserveMarker|EmptyString|Throw>]
[-PassThru]
[-Sheet <String>]
[-SheetIndex <Int32>]
-TemplateRow <Int32>
[-ThrowOnMissing]
[<CommonParameters>]
```

[#](#method-invoke-officeexceltemplaterow-string-exceldocument-object-exceltemplatemissingvaluebehavior-switchparameter-string-int32-int32-switchparameter)

Parameter set: `Document`

## Examples

### Fill invoice line rows from pipeline objects.

```powershell
$items | Invoke-OfficeExcelTemplateRow -Path .\Invoice.xlsx -Sheet Invoice -TemplateRow 12 -CultureName en-US
```

Copies the template row once per input object, applies marker values, and saves the workbook.

## Parameters

**-CultureName String optional**

Culture name used for built-in marker format aliases such as currency and date.

**-InputObject Object requiredposition: 1pipeline: True (ByValue)aliases: Data, Rows**

Pipeline data. Hashtables, dictionaries, PSCustomObjects, and typed objects are supported.

**-MissingValueBehavior ExcelTemplateMissingValueBehavior optional**

Behavior used when a marker is not supplied by each input row.

Possible values: `PreserveMarker`, `EmptyString`, `Throw`

**-PassThru SwitchParameter optional**

Returns the number of marker replacements.

**-Sheet String optional**

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

**-SheetIndex Int32 optional**

Worksheet index when using a workbook object or path.

**-TemplateRow Int32 required**

1-based row number that contains template markers to repeat.

**-ThrowOnMissing SwitchParameter optional**

Throws when a marker is not supplied by an input row.

**-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:9FB72286EE5EF54A5EF7AD7B6239F4152556C8AFBFAA4FBED7A705533F03D98D -->
