Cmdlet
Unprotect-OfficeExcelSheet
Removes worksheet protection.
Syntax
Unprotect-OfficeExcelSheet
[-Document <ExcelDocument>]
[-PassThru]
[-Sheet <OfficeSheetSelector>]
[<CommonParameters>]#Parameter set:
DefaultExamples
Remove sheet protection
Open-OfficeExcel -Path .\Finance\Pricing-Model.xlsx {
Unprotect-OfficeExcelSheet -Sheet Inputs
}Unprotects the Inputs sheet.
Update a protected sheet and protect it again
Open-OfficeExcel -Path .\Finance\Pricing-Model.xlsx {
ExcelSheet 'Rates' {
Unprotect-OfficeExcelSheet
ExcelCell B2 1.09
ExcelCell B3 0.86
Protect-OfficeExcelSheet -AllowSort
}
}Unprotects the price sheet, writes the new rates and restores protection with sorting allowed.
Parameters
- -Document ExcelDocument
- Caller-owned workbook; omission uses the enclosing Excel content block.
- -PassThru SwitchParameter
- Emits the native result after the operation.
- -Sheet OfficeSheetSelector
- Worksheet name, one-based position or native worksheet object. Multi-sheet commands also accept wildcard names.
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.