Cmdlet
Test-OfficeExcelWorkbook
Runs OfficeIMO workbook diagnostics and optional safe repairs.
Syntax
Examples
Gate a generated workbook before sending it to a user.
$doctor = Test-OfficeExcelWorkbook -Path .\Report.xlsx -SkipOpenXmlValidation
if (-not $doctor.Passed) {
$doctor.Issues |
Sort-Object Severity,Category,SheetName,Address |
Format-Table Severity,Category,SheetName,Address,Message,RepairAction
}Returns OfficeIMO workbook diagnostics for defined names, formulas, tables, drawings, connections, and package validation.
Parameters
- -Path String
- Workbook path.
- -Quiet SwitchParameter
- Return only a Boolean pass/fail value.
- -RepairDefinedNames SwitchParameter
- Repair duplicate, invalid, or broken defined names before reporting.
- -SkipOpenXmlValidation SwitchParameter
- Skip Open XML validator checks.
- -Document ExcelDocument
- Workbook document.
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.