Cmdlet
Update-OfficeExcelComment
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>]#Parameter set:
ContextUpdate-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>]#Parameter set:
PathUpdate-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>]#Parameter set:
DocumentExamples
Update a comment on one cell.
$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, TextReplaces matching comment text and optionally changes the author.
Parameters
- -Address String
- A1 cell address to match.
- -All SwitchParameter
- Allow updating all comments on the selected worksheet(s) when no filter is supplied.
- Replacement author name.
- -Initials String
- Replacement author initials.
- Existing comment author to match, ignoring case.
- -PassThru SwitchParameter
- Returns the number of comments updated.
- -Range String
- A1 cell or range to match.
- -Run Object[]
- Replacement rich text runs.
- -Sheet String
- Worksheet name to update. Defaults to the current DSL sheet or all workbook sheets.
- -SheetIndex Int32
- Worksheet index (0-based) to update. Defaults to the current DSL sheet or all workbook sheets.
- -Text String
- Replacement plain text.
- -TextContains String
- Existing text fragment to match, ignoring case.
- -Path String
- Workbook path to update.
- -Document ExcelDocument
- 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.