# Unprotect-OfficeExcelWorkbook

Removes workbook structure/window protection metadata.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

Aliases: ExcelWorkbookUnprotect

**Module**

`PSWriteOffice`

**Aliases**

`ExcelWorkbookUnprotect`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Outputs**

`OfficeIMO.Excel.ExcelDocument` `System.IO.FileInfo`

**Source**

[UnprotectOfficeExcelWorkbookCommand.cs:20](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/UnprotectOfficeExcelWorkbookCommand.cs#L20) 

Removes workbook structure/window protection metadata.

## Syntax

```
Unprotect-OfficeExcelWorkbook
[-PassThru]
[<CommonParameters>]
```

[#](#method-unprotect-officeexcelworkbook-switchparameter)

Parameter set: `Context`

```
Unprotect-OfficeExcelWorkbook
[-PassThru]
[-Path] <String>
[<CommonParameters>]
```

[#](#method-unprotect-officeexcelworkbook-switchparameter-string)

Parameter set: `Path`

```
Unprotect-OfficeExcelWorkbook
-Document <ExcelDocument>
[-PassThru]
[<CommonParameters>]
```

[#](#method-unprotect-officeexcelworkbook-exceldocument-switchparameter)

Parameter set: `Document`

## Examples

### Remove workbook-level protection metadata.

```powershell
Unprotect-OfficeExcelWorkbook -Path .\Report.xlsx
Test-OfficeExcelWorkbook -Path .\Report.xlsx -SkipOpenXmlValidation |
    Select-Object Passed, ProtectionSummary
```

Removes workbook structure/window protection metadata and saves the workbook.

## Parameters

**-PassThru SwitchParameter optional**

Emit the workbook after removing protection.

**-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path**

Workbook path to update.

**-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document**

Workbook to update outside the DSL context.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:0DE9E6746F2A454429FD6B32FD88E5DBAFF7579DDA3D4F0FC470F47070B4F1D7 -->
