Validate and Repair Excel Workbooks
Edit on GitHubPreflight workbook operations, test integrity and accessibility, diagnose package state, and apply deliberate repairs.
Validation is a delivery stage, not an incidental side effect of opening a workbook. Keep inspection separate from repair so an automation run cannot silently rewrite a source file.
Preflight first
Get-OfficeExcelRuntimePreflightreports runtime capabilities and warnings.Get-OfficeExcelPreflightreports workbook-specific readiness and repair hints.Test-OfficeExcelWorkbookchecks workbook integrity.Test-OfficeExcelAccessibilitychecks accessible-delivery concerns.Get-OfficeExcelSummary -IncludeSchemainventories package features such as queries, slicers, timelines, and external structures.
Repair explicitly
Use Repair-OfficeExcelWorkbook only after inspecting the proposed repair class and preserving the original when required. Reopen the result, repeat the integrity checks, and compare it with the source if preservation matters.
For automated delivery, a useful gate is: create or update, save, preflight, test integrity, test accessibility when applicable, compare against a reference contract, then publish. The operational dashboard provides a substantial artifact for exercising that path.