Cmdlet
Add-OfficeExcelComment
Adds a note or a threaded comment (or reply) to a cell.
Syntax
Add-OfficeExcelComment
[-Address] <String>
[-Author <String>]
[-Document <ExcelDocument>]
[-Initials <String>]
[-PassThru]
[-Sheet <OfficeSheetSelector>]
[-Text] <String>
[<CommonParameters>]#Parameter set:
NoteAdd-OfficeExcelComment
[-Address] <String>
[-Author <String>]
[-Date <DateTime>]
[-Document <ExcelDocument>]
[-Done]
[-Id <String>]
[-ParentId <String>]
[-PassThru]
[-Sheet <OfficeSheetSelector>]
[-Text] <String>
-Threaded
[<CommonParameters>]#Parameter set:
ThreadedExamples
Add a note to a cell
Open-OfficeExcel -Path .\Finance\Budget-2027.xlsx {
ExcelSheet 'Assumptions' {
ExcelComment B4 'Inflation from the October central bank projection.' -Author 'Finance'
}
}Explains the source of a figure in a note on B4.
Start a review thread
Open-OfficeExcel -Path .\Finance\Forecast-2027.xlsx {
ExcelSheet 'Forecast' {
ExcelComment F12 'Can we confirm the Q2 hiring plan before this goes to the board?' -Threaded -Author 'Anna Kowalska'
}
}Adds a threaded comment asking for confirmation of a forecast figure, attributed to the reviewer.
Parameters
- -Address String
- A1 address of the target cell.
- Author name (optional).
- -Document ExcelDocument
- Caller-owned workbook; omission uses the enclosing Excel content block.
- -Initials String
- Author initials, supplied together with Author.
- -PassThru SwitchParameter
- Emits the native result after the operation.
- -Sheet OfficeSheetSelector
- Worksheet name, one-based position or native worksheet object. Multi-sheet commands also accept wildcard names.
- -Text String
- Comment text.
- -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.
- -Threaded SwitchParameter
- Creates a threaded comment instead of a note.
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.