Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars669
Forks82
Open issues3
PowerShell Gallery downloads4509194
Releasev3.6.0
Language: C# Updated: 2026-11-09

Documentation

Update Existing Excel Workbooks

Replace values, edit rows, append table data, and make targeted workbook changes without rebuilding every sheet.

Existing-workbook automation should express the smallest useful mutation. That makes the script easier to review and reduces the chance of replacing formulas, styles, or unrelated worksheets.

Replace text or edit rows

Update-OfficeExcelText supports sheet and range boundaries, literal or regex matching, case sensitivity, and -WhatIf. Edit-OfficeExcelRow exposes a row object with header-aware access for conditional changes.

Update-OfficeExcelText -Path '.\Readiness.xlsx' -Sheet Readiness `
    -OldValue Draft -NewValue Ready

Edit-OfficeExcelRow -Path '.\Readiness.xlsx' -Sheet Readiness -ScriptBlock {
    param($row)
    if ($row.CellByHeader('Service').Value -eq 'Messaging') {
        $row.Set('Owner', 'Productivity')
    }
}

Append without rebuilding

Open the workbook with Get-OfficeExcel, pipe it to Add-OfficeExcelTableRow, and close with -Save. Other targeted commands update cells, formulas, styles, links, print settings, visibility, active sheet, filters, comments, validation, and workbook metadata.

The update-existing recipe combines workbook-wide text replacement with a header-aware row edit.