Cmdlet
Set-OfficeExcelTheme
Applies an OfficeTheme or theme XML to a workbook.
Syntax
Set-OfficeExcelTheme
[-Document <ExcelDocument>]
-Name <String>
[-PassThru]
[<CommonParameters>]#Parameter set:
NameSet-OfficeExcelTheme
[-Document <ExcelDocument>]
[-Name <String>]
[-PassThru]
[-Theme] <OfficeThemeInput>
[<CommonParameters>]#Parameter set:
ThemeSet-OfficeExcelTheme
[-Document <ExcelDocument>]
[-Name <String>]
[-PassThru]
-Xml <String>
[<CommonParameters>]#Parameter set:
XmlSet-OfficeExcelTheme
[-Document <ExcelDocument>]
[-Name <String>]
[-PassThru]
-XmlPath <String>
[<CommonParameters>]#Parameter set:
XmlPathExamples
Apply a built-in theme
Open-OfficeExcel -Path .\Reports\Q3-Sales.xlsx {
ExcelTheme Minimal
}Restyles the workbook's cell styles, table styles and charts with the Minimal theme.
Apply the corporate theme from a template
Open-OfficeExcel -Path .\Reports\Legacy-Report.xlsx {
ExcelTheme .\Templates\Northwind.xltx
}Takes the colours and fonts from the company template so an older workbook matches current branding.
Parameters
- -Document ExcelDocument
- Caller-owned workbook; omission uses the enclosing Excel content block.
- -Name String
- Optional workbook theme name to apply after writing the theme.
- -PassThru SwitchParameter
- Emits the native result after the operation.
- -Theme OfficeThemeInput
- Built-in Office theme, native theme object or a document whose visual theme is read.
- -Xml String
- Theme XML to write to the workbook theme part.
- -XmlPath String
- Literal path to an XML definition.
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.