Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficeExcelComment

Aliases: ExcelComment
Module
PSWriteOffice
Aliases
ExcelComment
Inputs
OfficeIMO.Excel.ExcelDocument

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: Note
Add-OfficeExcelComment
[-Address] <String>
[-Author <String>]
[-Date <DateTime>]
[-Document <ExcelDocument>]
[-Done]
[-Id <String>]
[-ParentId <String>]
[-PassThru]
[-Sheet <OfficeSheetSelector>]
[-Text] <String>
-Threaded
[<CommonParameters>]
#
Parameter set: Threaded

Examples

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 requiredposition: 0
A1 address of the target cell.
-Author String optional
Author name (optional).
-Document ExcelDocument optionalpipeline: True (ByValue)
Caller-owned workbook; omission uses the enclosing Excel content block.
-Initials String optionalsets: Note
Author initials, supplied together with Author.
-PassThru SwitchParameter optional
Emits the native result after the operation.
-Sheet OfficeSheetSelector optional
Worksheet name, one-based position or native worksheet object. Multi-sheet commands also accept wildcard names.
-Text String requiredposition: 1
Comment text.
-Date DateTime optionalsets: Threaded
Optional timestamp for the threaded comment.
-Done SwitchParameter optionalsets: Threaded
Mark the threaded comment as done/resolved.
-Id String optionalsets: Threaded
Optional stable threaded-comment id.
-ParentId String optionalsets: Threaded
Optional parent threaded-comment id when adding a reply.
-Threaded SwitchParameter requiredsets: Threaded
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.