API Reference

Cmdlet

Update-OfficeExcelComment

Aliases: ExcelCommentUpdate
Namespace PSWriteOffice
Aliases
ExcelCommentUpdate
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Int32

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

Remarks

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

Examples

Authored help example

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: Context

Parameters

Address String optionalposition: namedpipeline: False
A1 cell address to match.
All SwitchParameter optionalposition: namedpipeline: False
Allow updating all comments on the selected worksheet(s) when no filter is supplied.
Author String optionalposition: namedpipeline: False
Replacement author name.
Initials String optionalposition: namedpipeline: False
Replacement author initials.
MatchAuthor String optionalposition: namedpipeline: False
Existing comment author to match, ignoring case.
PassThru SwitchParameter optionalposition: namedpipeline: False
Returns the number of comments updated.
Range String optionalposition: namedpipeline: False
A1 cell or range to match.
Run Object[] optionalposition: namedpipeline: Falsealiases: Runs
Replacement rich text runs.
Sheet String optionalposition: namedpipeline: False
Worksheet name to update. Defaults to the current DSL sheet or all workbook sheets.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) to update. Defaults to the current DSL sheet or all workbook sheets.
Text String optionalposition: namedpipeline: False
Replacement plain text.
TextContains String optionalposition: namedpipeline: False
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: Path

Parameters

Address String optionalposition: namedpipeline: False
A1 cell address to match.
All SwitchParameter optionalposition: namedpipeline: False
Allow updating all comments on the selected worksheet(s) when no filter is supplied.
Author String optionalposition: namedpipeline: False
Replacement author name.
Initials String optionalposition: namedpipeline: False
Replacement author initials.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to update.
MatchAuthor String optionalposition: namedpipeline: False
Existing comment author to match, ignoring case.
PassThru SwitchParameter optionalposition: namedpipeline: False
Returns the number of comments updated.
Range String optionalposition: namedpipeline: False
A1 cell or range to match.
Run Object[] optionalposition: namedpipeline: Falsealiases: Runs
Replacement rich text runs.
Sheet String optionalposition: namedpipeline: False
Worksheet name to update. Defaults to the current DSL sheet or all workbook sheets.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) to update. Defaults to the current DSL sheet or all workbook sheets.
Text String optionalposition: namedpipeline: False
Replacement plain text.
TextContains String optionalposition: namedpipeline: False
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: Document

Parameters

Address String optionalposition: namedpipeline: False
A1 cell address to match.
All SwitchParameter optionalposition: namedpipeline: False
Allow updating all comments on the selected worksheet(s) when no filter is supplied.
Author String optionalposition: namedpipeline: False
Replacement author name.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to update outside the DSL context.
Initials String optionalposition: namedpipeline: False
Replacement author initials.
MatchAuthor String optionalposition: namedpipeline: False
Existing comment author to match, ignoring case.
PassThru SwitchParameter optionalposition: namedpipeline: False
Returns the number of comments updated.
Range String optionalposition: namedpipeline: False
A1 cell or range to match.
Run Object[] optionalposition: namedpipeline: Falsealiases: Runs
Replacement rich text runs.
Sheet String optionalposition: namedpipeline: False
Worksheet name to update. Defaults to the current DSL sheet or all workbook sheets.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) to update. Defaults to the current DSL sheet or all workbook sheets.
Text String optionalposition: namedpipeline: False
Replacement plain text.
TextContains String optionalposition: namedpipeline: False
Existing text fragment to match, ignoring case.

Outputs

System.Int32