Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Unprotect-OfficeExcelWorkbook

Aliases: ExcelWorkbookUnprotect
Namespace PSWriteOffice
Aliases
ExcelWorkbookUnprotect
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
OfficeIMO.Excel.ExcelDocument System.IO.FileInfo

Removes workbook structure/window protection metadata.

Remarks

Removes workbook structure/window protection metadata.

Examples

Authored help example

Remove workbook-level protection metadata.

PS>


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.

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

Unprotect-OfficeExcelWorkbook [-PassThru] [<CommonParameters>]
#
Parameter set: Context

Parameters

PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the workbook after removing protection.

Outputs

OfficeIMO.Excel.ExcelDocument, System.IO.FileInfo

Unprotect-OfficeExcelWorkbook [-PassThru] -Path <String> [<CommonParameters>]
#
Parameter set: Path

Parameters

PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the workbook after removing protection.
Path String requiredposition: 0pipeline: Falsealiases: FilePath, InputPath
Workbook path to update.

Outputs

OfficeIMO.Excel.ExcelDocument, System.IO.FileInfo

Unprotect-OfficeExcelWorkbook -Document <ExcelDocument> [-PassThru] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to update outside the DSL context.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the workbook after removing protection.

Outputs

OfficeIMO.Excel.ExcelDocument, System.IO.FileInfo