Cmdlet
Add-OfficeExcelThreadedComment
Adds a threaded comment or reply to an Excel worksheet.
Syntax
Add-OfficeExcelThreadedComment -Address <String> [-Author <String>] [-Date <DateTime>] [-Done] [-Id <String>] [-ParentId <String>] [-PassThru] -Text <String> [<CommonParameters>]#Parameter set:
ContextAdd-OfficeExcelThreadedComment -Address <String> [-Author <String>] [-Date <DateTime>] [-Done] [-Id <String>] [-NoSave] [-ParentId <String>] [-PassThru] [-Path] <String> [-Sheet <String>] [-SheetIndex <Int32>] -Text <String> [<CommonParameters>]#Parameter set:
PathAdd-OfficeExcelThreadedComment -Address <String> [-Author <String>] [-Date <DateTime>] -Document <ExcelDocument> [-Done] [-Id <String>] [-ParentId <String>] [-PassThru] [-Sheet <String>] [-SheetIndex <Int32>] -Text <String> [<CommonParameters>]#Parameter set:
DocumentExamples
Add a threaded review note and audit it before sharing.
$comment = Add-OfficeExcelThreadedComment -Path .\Review.xlsx -Sheet Data -Address C5 -Text 'Please confirm this variance.' -Author 'Finance Reviewer' -PassThru
Add-OfficeExcelThreadedComment -Path .\Review.xlsx -Sheet Data -Address C5 -Text 'Confirmed with sales ops.' -Author 'Report Owner' -ParentId $comment.Id
Get-OfficeExcelCommentAudit -Path .\Review.xlsx -IncludeComments |
Select-Object -ExpandProperty ThreadedCommentsUses OfficeIMO threaded-comment metadata authoring, including workbook person metadata, and keeps legacy notes separate.
Parameters
- -Address String
- A1-style cell address, such as C5.
- Author display name stored in workbook person metadata.
- -Date DateTime
- Optional timestamp for the threaded comment.
- -Done SwitchParameter
- Mark the threaded comment as done/resolved.
- -Id String
- Optional stable threaded-comment id.
- -ParentId String
- Optional parent threaded-comment id when adding a reply.
- -PassThru SwitchParameter
- Emit threaded-comment metadata.
- -Text String
- Threaded comment text.
- -NoSave SwitchParameter
- Do not save when operating on a path-owned workbook.
- -Path String
- Workbook path to update.
- -Sheet String
- Worksheet name when using path or document input.
- -SheetIndex Int32
- Worksheet index (0-based) when using path or document input.
- -Document ExcelDocument
- Workbook to operate on 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.