Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeExcelTestOptions

Module
PSWriteOffice
Inputs
None

Creates Excel checks for Test-OfficeDocument: capability preflight and package validation.

Syntax

New-OfficeExcelTestOptions
[-Capability <ExcelPreflightCapability[]>]
[-IncludeFeatures]
[-IncludeRepairHints]
[-NoOpenXmlValidation]
[<CommonParameters>]
#
Parameter set: Default

Examples

Check that formulas can be calculated

Test-OfficeDocument -Path .\Finance\Budget-2027.xlsx -Options (New-OfficeExcelTestOptions -Capability CalculateFormulas)

Tests whether OfficeIMO can calculate the formulas in a workbook.

Preflight templates before a report run

$checks = New-OfficeExcelTestOptions -Capability BindTemplate, ExportPdfReport -IncludeRepairHints
Get-ChildItem -Path .\Templates -Filter *.xltx |
    Test-OfficeDocument -Options $checks

Checks each template for template binding and PDF export and includes repair hints for anything that fails.

Parameters

-Capability ExcelPreflightCapability[] optional
Capabilities to evaluate or enforce. Defaults to all capabilities.
Possible values: ReadWorkbookData, EditCellValues, EditWorkbookStructure, UseCachedFormulaValues, CalculateFormulas, BindTemplate, ExportPdfReport
-IncludeFeatures SwitchParameter optional
Include discovered feature rows in object output.
-IncludeRepairHints SwitchParameter optional
Include actionable OfficeIMO repair hints for blocked capabilities.
-NoOpenXmlValidation SwitchParameter optional
Skips native Open XML schema validation while retaining other workbook checks.

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.