# Invoke-OfficeExcelTemplateSheet

Repeats an Excel template worksheet for pipeline data and applies markers in each generated sheet.

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: ExcelTemplateSheet, ExcelTemplateSheets

**Module**

`PSWriteOffice`

**Aliases**

`ExcelTemplateSheet` `ExcelTemplateSheets`

**Inputs**

`System.Object`

**Outputs**

`System.Int32`

**Source**

[InvokeOfficeExcelTemplateSheetCommand.cs:20](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/InvokeOfficeExcelTemplateSheetCommand.cs#L20) 

Repeats an Excel template worksheet for pipeline data and applies markers in each generated sheet.

## Syntax

```
Invoke-OfficeExcelTemplateSheet
[-CultureName <String>]
[-Item] <Object>
[-MissingValueBehavior <PreserveMarker|EmptyString|Throw>]
[-PassThru]
[-SheetNameProperty <String>]
[-TemplateSheet <String>]
[-ThrowOnMissing]
[<CommonParameters>]
```

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

Parameter set: `Context`

```
Invoke-OfficeExcelTemplateSheet
[-CultureName <String>]
[-Item] <Object>
[-MissingValueBehavior <PreserveMarker|EmptyString|Throw>]
[-PassThru]
[-Path] <String>
[-SheetNameProperty <String>]
[-TemplateSheet <String>]
[-ThrowOnMissing]
[<CommonParameters>]
```

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

Parameter set: `Path`

```
Invoke-OfficeExcelTemplateSheet
[-CultureName <String>]
-Document <ExcelDocument>
[-Item] <Object>
[-MissingValueBehavior <PreserveMarker|EmptyString|Throw>]
[-PassThru]
[-SheetNameProperty <String>]
[-TemplateSheet <String>]
[-ThrowOnMissing]
[<CommonParameters>]
```

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

Parameter set: `Document`

## Examples

### Create one invoice worksheet per pipeline object.

```powershell
$invoices | Invoke-OfficeExcelTemplateSheet -Path .\Invoices.xlsx -TemplateSheet Template -SheetNameProperty SheetName
```

Uses the template sheet for the first object, copies it for later objects, binds markers, and saves the workbook.

## Parameters

**-CultureName String optional**

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

**-Item Object requiredposition: 1pipeline: True (ByValue)aliases: Data, InputObject, 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 item.

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

**-PassThru SwitchParameter optional**

Returns the number of marker replacements.

**-SheetNameProperty String optionalaliases: NameProperty**

Input property used as the generated worksheet name.

**-TemplateSheet String optionalaliases: Sheet, WorksheetName**

Template worksheet name. Defaults to the current sheet inside an ExcelSheet block or the first sheet for path/document use.

**-ThrowOnMissing SwitchParameter optional**

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

**-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path**

Workbook path to update.

**-Document ExcelDocument requiredsets: 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:F9290694868542C57306E0F79ED4A38601466EF9D8285C5D961E1F85C4FE6C15 -->
