Project

PSWriteOffice

PSWriteOffice is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars158
Forks14
Open issues0
PowerShell Gallery downloads158661
Releasev3.0.5
Language: C# Updated: 2026-08-20T06:15:04.0000000+00:00

Documentation

Merge and Compare Excel Workbooks

Consolidate selected worksheets and produce explicit workbook or range differences for review and delivery gates.

Workbook consolidation and workbook comparison solve different problems. Joining copies selected sheets into a target workbook. Comparing reports how two workbooks differ without combining them.

Consolidate selected sheets

Join-OfficeExcelWorkbook -InputPath '.\Consolidated.xlsx' `
    -SourcePath '.\Regions.xlsx' `
    -SourceSheet North,South `
    -SheetNamePrefix 'Region '

Use a stable prefix when sources can contain the same sheet names. Copy mode and name-validation options let the operation match the preservation and naming policy.

Compare a candidate

Compare-OfficeExcelWorkbook checks cells, styles, named ranges, tables, worksheet metadata, and comments. Skip categories only when the delivery contract says they do not matter. Compare-OfficeExcelRange narrows the comparison to a known business area.

The merge-workbooks recipe consolidates two regional sheets. The compare-workbooks recipe creates a controlled cell difference and reports it.

After a merge, run the checks described in validation and repair.