# Add-OfficeExcelSlicer

Adds OfficeIMO-owned workbook slicer binding metadata.

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: ExcelSlicer

**Module**

`PSWriteOffice`

**Aliases**

`ExcelSlicer`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Outputs**

`System.Management.Automation.PSObject`

**Source**

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

Adds OfficeIMO-owned workbook slicer binding metadata.

## Syntax

```
Add-OfficeExcelSlicer
-Name <String>
[-PassThru]
[-PivotTableName <String>]
[-SourceName <String>]
[-Xml <String>]
[<CommonParameters>]
```

[#](#method-add-officeexcelslicer-string-switchparameter-string-string-string)

Parameter set: `Context`

```
Add-OfficeExcelSlicer
-Name <String>
[-PassThru]
[-Path] <String>
[-PivotTableName <String>]
[-SourceName <String>]
[-Xml <String>]
[<CommonParameters>]
```

[#](#method-add-officeexcelslicer-string-switchparameter-string-string-string-string)

Parameter set: `Path`

```
Add-OfficeExcelSlicer
-Document <ExcelDocument>
-Name <String>
[-PassThru]
[-PivotTableName <String>]
[-SourceName <String>]
[-Xml <String>]
[<CommonParameters>]
```

[#](#method-add-officeexcelslicer-exceldocument-string-switchparameter-string-string-string)

Parameter set: `Document`

## Examples

### Add slicer binding metadata for a pivot field.

```powershell
$slicer = Add-OfficeExcelSlicer -Path .\Report.xlsx -Name RegionSlicer -SourceName Region -PivotTableName SalesPivot -PassThru
Get-OfficeExcelDataModel -Path .\Report.xlsx |
    Select-Object -ExpandProperty SlicerCacheCount
```

Writes portable OfficeIMO binding metadata. It does not create native Excel slicer caches or UI shapes.

## Parameters

**-Name String required**

Slicer cache name.

**-PassThru SwitchParameter optional**

Emit metadata about the added package part.

**-PivotTableName String optional**

Pivot table name the slicer is intended to filter.

**-SourceName String optional**

Source field, table column, or pivot field name.

**-Xml String optional**

Caller-supplied slicer cache XML. When provided, OfficeIMO preserves it within its pivot-interaction metadata envelope.

**-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:2055C7ED85C938B6D29D3E8F473531A6EFBFCD43A31AA9BBC7EDB340DA0DF21B -->
