API Reference

Cmdlet

Get-OfficeExcelComment

Aliases: ExcelComments
Namespace PSWriteOffice
Aliases
ExcelComments
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Management.Automation.PSObject

Gets legacy worksheet comments (notes) from one or more worksheets.

Remarks

Gets legacy worksheet comments (notes) from one or more worksheets.

Examples

Authored help example

Find comments containing review text.

PS>


$comments = Get-OfficeExcelComment -Path .\Report.xlsx -Sheet Data -TextContains review
            $comments |
                Select-Object SheetName, Address, Author, Text
        

Returns matching comment metadata without modifying the workbook.

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

Get-OfficeExcelComment [-Address <String>] [-Author <String>] [-Range <String>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-TextContains <String>] [<CommonParameters>]
#
Parameter set: Context

Parameters

Address String optionalposition: namedpipeline: False
A1 cell address to match.
Author String optionalposition: namedpipeline: False
Comment author to match, ignoring case.
Range String optionalposition: namedpipeline: False
A1 cell or range to match.
Sheet String optionalposition: namedpipeline: False
Worksheet name to inspect. Defaults to the current DSL sheet or all workbook sheets.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) to inspect. Defaults to the current DSL sheet or all workbook sheets.
TextContains String optionalposition: namedpipeline: False
Text fragment to match, ignoring case.

Outputs

System.Management.Automation.PSObject

Get-OfficeExcelComment [-Address <String>] [-Author <String>] -InputPath <String> [-Range <String>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-TextContains <String>] [<CommonParameters>]
#
Parameter set: Path

Parameters

Address String optionalposition: namedpipeline: False
A1 cell address to match.
Author String optionalposition: namedpipeline: False
Comment author to match, ignoring case.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to inspect.
Range String optionalposition: namedpipeline: False
A1 cell or range to match.
Sheet String optionalposition: namedpipeline: False
Worksheet name to inspect. Defaults to the current DSL sheet or all workbook sheets.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) to inspect. Defaults to the current DSL sheet or all workbook sheets.
TextContains String optionalposition: namedpipeline: False
Text fragment to match, ignoring case.

Outputs

System.Management.Automation.PSObject

Get-OfficeExcelComment [-Address <String>] [-Author <String>] -Document <ExcelDocument> [-Range <String>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-TextContains <String>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Address String optionalposition: namedpipeline: False
A1 cell address to match.
Author String optionalposition: namedpipeline: False
Comment author to match, ignoring case.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to inspect outside the DSL context.
Range String optionalposition: namedpipeline: False
A1 cell or range to match.
Sheet String optionalposition: namedpipeline: False
Worksheet name to inspect. Defaults to the current DSL sheet or all workbook sheets.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) to inspect. Defaults to the current DSL sheet or all workbook sheets.
TextContains String optionalposition: namedpipeline: False
Text fragment to match, ignoring case.

Outputs

System.Management.Automation.PSObject