Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeExcelCompareOptions

Module
PSWriteOffice
Inputs
None

Creates workbook comparison settings for Compare-OfficeDocument.

Syntax

New-OfficeExcelCompareOptions
[-Exclude <ExcelCompareArea[]>]
[<CommonParameters>]
#
Parameter set: Default

Examples

Compare values only

Compare-OfficeDocument -ReferencePath .\Finance\Budget-v1.xlsx -DifferencePath .\Finance\Budget-v2.xlsx -Options (New-OfficeExcelCompareOptions -Exclude CellStyles)

Compares two versions of a workbook while ignoring cell style changes.

Review content changes between releases

$compare = New-OfficeExcelCompareOptions -Exclude CellStyles, Comments
Compare-OfficeDocument -ReferencePath .\Pricing\Price-List-2026-09.xlsx -DifferencePath .\Pricing\Price-List-2026-10.xlsx -Options $compare -OutputPath .\Pricing\Price-Changes-October.xlsx

Compares last month's and this month's price list, ignoring styles and comments, and saves the comparison report.

Parameters

-Exclude ExcelCompareArea[] optional
Worksheet names or wildcard patterns omitted from the navigation list.
Possible values: Cells, CellStyles, NamedRanges, Tables, WorksheetMetadata, Comments

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.