# Edit-OfficeExcelRow

Runs a script block against editable worksheet rows.

Project

PSWriteOffice

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

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

Aliases: Edit-ExcelRow, ExcelRowEdit

**Module**

`PSWriteOffice`

**Aliases**

`Edit-ExcelRow` `ExcelRowEdit`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Outputs**

`PSWriteOffice.Services.Excel.ExcelPowerShellRowEdit`

**Source**

[EditOfficeExcelRowCommand.cs:17](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/EditOfficeExcelRowCommand.cs#L17) 

Runs a script block against editable worksheet rows.

## Syntax

```
Edit-OfficeExcelRow
[-NumericAsDecimal]
[-PassThru]
[-Path] <String>
[-Range <String>]
[-ScriptBlock] <ScriptBlock>
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]
```

[#](#method-edit-officeexcelrow-switchparameter-switchparameter-string-string-scriptblock-string-int32)

Parameter set: `Path`

```
Edit-OfficeExcelRow
-Document <ExcelDocument>
[-NumericAsDecimal]
[-PassThru]
[-Range <String>]
[-ScriptBlock] <ScriptBlock>
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]
```

[#](#method-edit-officeexcelrow-exceldocument-switchparameter-switchparameter-string-scriptblock-string-int32)

Parameter set: `Document`

## Examples

### Edit rows by header name.

```powershell
Edit-OfficeExcelRow -Path .\Report.xlsx -Sheet Data -ScriptBlock { param($row) if ($row.Get[string]('Status') -eq 'Draft') { $row.Set('Status', 'Ready') } }
```

Loads editable row handles, lets the script update cells, and saves the workbook.

## Parameters

**-NumericAsDecimal SwitchParameter optional**

Prefer decimals instead of doubles for numeric values.

**-PassThru SwitchParameter optional**

Emit each editable row after the script block runs.

**-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path**

Workbook path to update.

**-Range String optional**

A1 range to expose as editable rows. Defaults to the worksheet used range.

**-ScriptBlock ScriptBlock requiredposition: 1**

Script block to run once per editable row. The row is passed as the first argument.

**-Sheet String optionalaliases: WorksheetName**

Worksheet name. Defaults to the current sheet inside an ExcelSheet block.

**-SheetIndex Int32 optional**

Worksheet index when using a workbook object or path.

**-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document**

Workbook to update outside the DSL context.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

## Outputs

PSWriteOffice.Services.Excel.ExcelPowerShellRowEdit: Header-aware editable worksheet row used by Edit-OfficeExcelRow.

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:7F314E812E0AE6ED6AD4F35FCEFF14C9461C5A8ACF24C0B33C1B7F9CB64B8A36 -->
