Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Get-OfficeExcelFormula

Module
PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelDocument System.String[]
Outputs
OfficeIMO.Excel.ExcelFormulaInfo

Lists native formula records, optionally filtered by worksheet, volatile functions or external references.

Syntax

Get-OfficeExcelFormula
[-Document <ExcelDocument>]
[-External]
[-Sheet <OfficeSheetSelector[]>]
[-Volatile]
[<CommonParameters>]
#
Parameter set: Document
Get-OfficeExcelFormula
[-External]
[-Path] <String[]>
[-Sheet <OfficeSheetSelector[]>]
[-Volatile]
[<CommonParameters>]
#
Parameter set: Path
Get-OfficeExcelFormula
[-External]
-LiteralPath <String[]>
[-Sheet <OfficeSheetSelector[]>]
[-Volatile]
[<CommonParameters>]
#
Parameter set: LiteralPath

Examples

Find volatile formulas without opening Excel.

Get-OfficeExcelFormula -Path .\Models\*.xlsx -Volatile | Format-Table SheetName, Address, Formula

Inspect literal file names from the pipeline.

Get-ChildItem -LiteralPath .\Models -Filter *.xlsx | Get-OfficeExcelFormula -External

Parameters

-Document ExcelDocument optionalpipeline: True (ByValue)sets: Document
Caller-owned workbook; omission uses the enclosing Excel content block.
-External SwitchParameter optional
Return only formulas referring to external workbooks.
-Sheet OfficeSheetSelector[] optional
Worksheet names, wildcard patterns, one-based positions or native worksheet objects.
-Volatile SwitchParameter optional
Return only formulas containing volatile functions.
-Path String[] requiredposition: 0pipeline: True (ByValue)sets: Path
Workbook paths, including filesystem wildcard patterns.
-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath
Literal workbook paths. FileInfo.FullName and provider PSPath bind here.

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.