API Reference

Cmdlet

Find-OfficeExcel

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

Finds text in worksheet values.

Remarks

Finds text in worksheet values.

Examples

Authored help example

Find status values and export their addresses.

PS>


$matches = Find-OfficeExcel -Path .\Report.xlsx -Text Ready -Sheet Summary
            $matches |
                Select-Object -Property Sheet, Address, Value |
                Export-Csv -Path .\ReadyCells.csv -NoTypeInformation
        

Returns matching cells with sheet, address, row, column, and value metadata for review or proof.

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

Find-OfficeExcel [-CaseSensitive] [-Exact] -InputPath <String> [-Range <String>] [-Regex] [-Sheet <String>] [-SheetIndex <Nullable`1>] -Text <String> [<CommonParameters>]
#
Parameter set: Path

Parameters

CaseSensitive SwitchParameter optionalposition: namedpipeline: False
Use case-sensitive matching.
Exact SwitchParameter optionalposition: namedpipeline: False
Require an exact cell text match instead of substring matching.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to inspect.
Range String optionalposition: namedpipeline: False
A1 range to search. Defaults to each selected worksheet's used range.
Regex SwitchParameter optionalposition: namedpipeline: False
Treat -Text as a regular expression.
Sheet String optionalposition: namedpipeline: Falsealiases: WorksheetName
Worksheet name. Defaults to all sheets for path/document use and current sheet inside an ExcelSheet block.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index when using a workbook object or path.
Text String requiredposition: 1pipeline: False
Text or pattern to find.

Outputs

System.Management.Automation.PSObject

Find-OfficeExcel [-CaseSensitive] -Document <ExcelDocument> [-Exact] [-Range <String>] [-Regex] [-Sheet <String>] [-SheetIndex <Nullable`1>] -Text <String> [<CommonParameters>]
#
Parameter set: Document

Parameters

CaseSensitive SwitchParameter optionalposition: namedpipeline: False
Use case-sensitive matching.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to inspect outside the DSL context.
Exact SwitchParameter optionalposition: namedpipeline: False
Require an exact cell text match instead of substring matching.
Range String optionalposition: namedpipeline: False
A1 range to search. Defaults to each selected worksheet's used range.
Regex SwitchParameter optionalposition: namedpipeline: False
Treat -Text as a regular expression.
Sheet String optionalposition: namedpipeline: Falsealiases: WorksheetName
Worksheet name. Defaults to all sheets for path/document use and current sheet inside an ExcelSheet block.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index when using a workbook object or path.
Text String requiredposition: 1pipeline: False
Text or pattern to find.

Outputs

System.Management.Automation.PSObject