API Reference
Cmdlet
Update-OfficeExcelComment
Updates legacy worksheet comments (notes) that match a filter.
Remarks
Updates legacy worksheet comments (notes) that match a filter.
Examples
Update a comment on one cell.
PS>
$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.
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.
Syntax
Update-OfficeExcelComment [-Address <String>] [-All] [-Author <String>] [-Initials <String>] [-MatchAuthor <String>] [-PassThru] [-Range <String>] [-Run <Object[]>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-Text <String>] [-TextContains <String>] [<CommonParameters>]#Parameter set:
ContextParameters
- Address String
- A1 cell address to match.
- All SwitchParameter
- Allow updating all comments on the selected worksheet(s) when no filter is supplied.
- Author String
- Replacement author name.
- Initials String
- Replacement author initials.
- MatchAuthor String
- 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 Nullable`1
- 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.
Outputs
System.Int32
Update-OfficeExcelComment [-Address <String>] [-All] [-Author <String>] [-Initials <String>] -InputPath <String> [-MatchAuthor <String>] [-PassThru] [-Range <String>] [-Run <Object[]>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-Text <String>] [-TextContains <String>] [<CommonParameters>]#Parameter set:
PathParameters
- Address String
- A1 cell address to match.
- All SwitchParameter
- Allow updating all comments on the selected worksheet(s) when no filter is supplied.
- Author String
- Replacement author name.
- Initials String
- Replacement author initials.
- InputPath String
- Workbook path to update.
- MatchAuthor String
- 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 Nullable`1
- 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.
Outputs
System.Int32
Update-OfficeExcelComment [-Address <String>] [-All] [-Author <String>] -Document <ExcelDocument> [-Initials <String>] [-MatchAuthor <String>] [-PassThru] [-Range <String>] [-Run <Object[]>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-Text <String>] [-TextContains <String>] [<CommonParameters>]#Parameter set:
DocumentParameters
- Address String
- A1 cell address to match.
- All SwitchParameter
- Allow updating all comments on the selected worksheet(s) when no filter is supplied.
- Author String
- Replacement author name.
- Document ExcelDocument
- Workbook to update outside the DSL context.
- Initials String
- Replacement author initials.
- MatchAuthor String
- 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 Nullable`1
- 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.
Outputs
System.Int32