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 -InputPath <String> [-PassThru] [<CommonParameters>]
#
Parameter set: Path

Parameters

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

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