API Reference
Cmdlet
Repair-OfficeExcelWorkbook
Runs OfficeIMO safe workbook repairs for common package, table, view, print, drawing, and calculation artifacts.
Remarks
Runs OfficeIMO safe workbook repairs for common package, table, view, print, drawing, and calculation artifacts.
Examples
Repair workbook package artifacts before handing the file to users.
PS>
$repair = Repair-OfficeExcelWorkbook -Path .\QuarterlyReport.xlsx -PassThru
$repair.Actions | Format-Table Category,SheetName,Message
if ($repair.After.HasErrors) {
$repair.After.Issues | Format-Table Severity,Category,SheetName,Address,Message
}
Uses the reusable OfficeIMO repair pipeline. The command normalizes safe workbook artifacts and returns before/after diagnostics when -PassThru is used.
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
Repair-OfficeExcelWorkbook -InputPath <String> [-NoSave] [-PassThru] [-SkipCalculation] [-SkipDefinedNames] [-SkipDrawings] [-SkipPrintSettings] [-SkipSheetViews] [-SkipTables] [<CommonParameters>]#Parameter set:
PathParameters
- InputPath String
- Workbook path to repair.
- NoSave SwitchParameter
- Do not save after applying repairs to an open document.
- PassThru SwitchParameter
- Emit a repair report object.
- SkipCalculation SwitchParameter
- Skip calculation-chain cleanup and recalc-on-open metadata.
- SkipDefinedNames SwitchParameter
- Skip defined-name repairs.
- SkipDrawings SwitchParameter
- Skip drawing, image, and header/footer picture repairs.
- SkipPrintSettings SwitchParameter
- Skip print, page-break, and page-scale repairs.
- SkipSheetViews SwitchParameter
- Skip worksheet view and freeze-pane repairs.
- SkipTables SwitchParameter
- Skip worksheet table repairs.
Outputs
System.Management.Automation.PSObject
Repair-OfficeExcelWorkbook -Document <ExcelDocument> [-NoSave] [-PassThru] [-SkipCalculation] [-SkipDefinedNames] [-SkipDrawings] [-SkipPrintSettings] [-SkipSheetViews] [-SkipTables] [<CommonParameters>]#Parameter set:
DocumentParameters
- Document ExcelDocument
- Open workbook document to repair.
- NoSave SwitchParameter
- Do not save after applying repairs to an open document.
- PassThru SwitchParameter
- Emit a repair report object.
- SkipCalculation SwitchParameter
- Skip calculation-chain cleanup and recalc-on-open metadata.
- SkipDefinedNames SwitchParameter
- Skip defined-name repairs.
- SkipDrawings SwitchParameter
- Skip drawing, image, and header/footer picture repairs.
- SkipPrintSettings SwitchParameter
- Skip print, page-break, and page-scale repairs.
- SkipSheetViews SwitchParameter
- Skip worksheet view and freeze-pane repairs.
- SkipTables SwitchParameter
- Skip worksheet table repairs.
Outputs
System.Management.Automation.PSObject