Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeExcelRepairOptions

Module
PSWriteOffice
Inputs
None

Creates Excel repair settings for Repair-OfficeDocument.

Syntax

New-OfficeExcelRepairOptions
[-Area <ExcelRepairArea[]>]
[<CommonParameters>]
#
Parameter set: Default

Examples

Repair defined names and tables

Repair-OfficeDocument -Path .\Reports\Broken.xlsx -OutputPath .\Reports\Repaired.xlsx -Options (New-OfficeExcelRepairOptions -Area DefinedNames, Tables)

Repairs only the defined names and tables of a damaged workbook and writes the result to a new file.

Repair print settings across a folder

$repair = New-OfficeExcelRepairOptions -Area SheetViews, PrintSettings
Get-ChildItem -Path \\files\Migrated -Filter *.xlsx |
    Repair-OfficeDocument -Options $repair -PassThru

Fixes sheet views and print settings in every workbook of a migrated share, leaving formulas and drawings untouched.

Parameters

-Area ExcelRepairArea[] optional
Native workbook areas included in the operation; omitted selection uses the native default.
Possible values: DefinedNames, Tables, SheetViews, PrintSettings, Protection, AutoFilters, Drawings, LinksAndComments, Calculation, WorkbookArtifacts

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.