Cmdlet
New-OfficeExcelCompareOptions
Creates workbook comparison settings for Compare-OfficeDocument.
Syntax
New-OfficeExcelCompareOptions
[-Exclude <ExcelCompareArea[]>]
[<CommonParameters>]#Parameter set:
DefaultExamples
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.xlsxCompares last month's and this month's price list, ignoring styles and comments, and saves the comparison report.
Parameters
- -Exclude ExcelCompareArea[]
- 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.