Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars160
Forks14
Open issues0
PowerShell Gallery downloads158661
Releasev3.0.5
Language: C# Updated: 2026-09-07T07:20:15.0000000+00:00

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.