# Update-OfficeExcelComment

Updates legacy worksheet comments (notes) that match a filter.

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 **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: ExcelCommentUpdate

**Module**

`PSWriteOffice`

**Aliases**

`ExcelCommentUpdate`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Outputs**

`System.Int32`

**Source**

[UpdateOfficeExcelCommentCommand.cs:20](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/UpdateOfficeExcelCommentCommand.cs#L20) 

Updates legacy worksheet comments (notes) that match a filter.

## Syntax

```
Update-OfficeExcelComment
[-Address <String>]
[-All]
[-Author <String>]
[-Initials <String>]
[-MatchAuthor <String>]
[-PassThru]
[-Range <String>]
[-Run <Object[]>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-Text <String>]
[-TextContains <String>]
[<CommonParameters>]
```

[#](#method-update-officeexcelcomment-string-switchparameter-string-string-string-switchparameter-string-object-string-int32-string-string)

Parameter set: `Context`

```
Update-OfficeExcelComment
[-Address <String>]
[-All]
[-Author <String>]
[-Initials <String>]
[-MatchAuthor <String>]
[-PassThru]
[-Path] <String>
[-Range <String>]
[-Run <Object[]>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-Text <String>]
[-TextContains <String>]
[<CommonParameters>]
```

[#](#method-update-officeexcelcomment-string-switchparameter-string-string-string-switchparameter-string-string-object-string-int32-string-string)

Parameter set: `Path`

```
Update-OfficeExcelComment
[-Address <String>]
[-All]
[-Author <String>]
-Document <ExcelDocument>
[-Initials <String>]
[-MatchAuthor <String>]
[-PassThru]
[-Range <String>]
[-Run <Object[]>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-Text <String>]
[-TextContains <String>]
[<CommonParameters>]
```

[#](#method-update-officeexcelcomment-string-switchparameter-string-exceldocument-string-string-switchparameter-string-object-string-int32-string-string)

Parameter set: `Document`

## Examples

### Update a comment on one cell.

```powershell
$updated = Update-OfficeExcelComment -Path .\Report.xlsx -Sheet Data -Address B2 -Text 'Reviewed' -Author Carol -Initials CC -PassThru
Get-OfficeExcelComment -Path .\Report.xlsx -Sheet Data -Address B2 |
    Select-Object Address, Author, Text
```

Replaces matching comment text and optionally changes the author.

## Parameters

**-Address String optional**

A1 cell address to match.

**-All SwitchParameter optional**

Allow updating all comments on the selected worksheet(s) when no filter is supplied.

**-Author String optional**

Replacement author name.

**-Initials String optional**

Replacement author initials.

**-MatchAuthor String optional**

Existing comment author to match, ignoring case.

**-PassThru SwitchParameter optional**

Returns the number of comments updated.

**-Range String optional**

A1 cell or range to match.

**-Run Object[] optionalaliases: Runs**

Replacement rich text runs.

**-Sheet String optional**

Worksheet name to update. Defaults to the current DSL sheet or all workbook sheets.

**-SheetIndex Int32 optional**

Worksheet index (0-based) to update. Defaults to the current DSL sheet or all workbook sheets.

**-Text String optional**

Replacement plain text.

**-TextContains String optional**

Existing text fragment to match, ignoring case.

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

Workbook path to update.

**-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).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:41D9E151C3602BBDD257574BE71F8D1E0BB6AB36B042E30C5A170220E2F733BC -->
