OfficeIMO

API Reference

Command

Protect-OfficeExcelSheet

Namespace PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Object

Protects the current worksheet.

Remarks

Protects the current worksheet.

Examples

Protect the active sheet with default options.


PS>ExcelSheet 'Data' { Protect-OfficeExcelSheet }
        

Enables worksheet protection.

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

Protect-OfficeExcelSheet [-AllowAutoFilter <Boolean>] [-AllowDeleteColumns <Boolean>] [-AllowDeleteRows <Boolean>] [-AllowFormatCells <Boolean>] [-AllowFormatColumns <Boolean>] [-AllowFormatRows <Boolean>] [-AllowInsertColumns <Boolean>] [-AllowInsertHyperlinks <Boolean>] [-AllowInsertRows <Boolean>] [-AllowPivotTables <Boolean>] [-AllowSelectLockedCells <Boolean>] [-AllowSelectUnlockedCells <Boolean>] [-AllowSort <Boolean>] [-PassThru] [<CommonParameters>]
#
Parameter set: Context

Parameters

AllowAutoFilter Boolean optionalposition: namedpipeline: False
Allow AutoFilter.
AllowDeleteColumns Boolean optionalposition: namedpipeline: False
Allow deleting columns.
AllowDeleteRows Boolean optionalposition: namedpipeline: False
Allow deleting rows.
AllowFormatCells Boolean optionalposition: namedpipeline: False
Allow formatting cells.
AllowFormatColumns Boolean optionalposition: namedpipeline: False
Allow formatting columns.
AllowFormatRows Boolean optionalposition: namedpipeline: False
Allow formatting rows.
AllowInsertColumns Boolean optionalposition: namedpipeline: False
Allow inserting columns.
AllowInsertHyperlinks Boolean optionalposition: namedpipeline: False
Allow inserting hyperlinks.
AllowInsertRows Boolean optionalposition: namedpipeline: False
Allow inserting rows.
AllowPivotTables Boolean optionalposition: namedpipeline: False
Allow PivotTables.
AllowSelectLockedCells Boolean optionalposition: namedpipeline: False
Allow selecting locked cells.
AllowSelectUnlockedCells Boolean optionalposition: namedpipeline: False
Allow selecting unlocked cells.
AllowSort Boolean optionalposition: namedpipeline: False
Allow sorting.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after protection.

Outputs

System.Object

Protect-OfficeExcelSheet [-AllowAutoFilter <Boolean>] [-AllowDeleteColumns <Boolean>] [-AllowDeleteRows <Boolean>] [-AllowFormatCells <Boolean>] [-AllowFormatColumns <Boolean>] [-AllowFormatRows <Boolean>] [-AllowInsertColumns <Boolean>] [-AllowInsertHyperlinks <Boolean>] [-AllowInsertRows <Boolean>] [-AllowPivotTables <Boolean>] [-AllowSelectLockedCells <Boolean>] [-AllowSelectUnlockedCells <Boolean>] [-AllowSort <Boolean>] -Document <ExcelDocument> [-PassThru] [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]
#
Parameter set: Document

Parameters

AllowAutoFilter Boolean optionalposition: namedpipeline: False
Allow AutoFilter.
AllowDeleteColumns Boolean optionalposition: namedpipeline: False
Allow deleting columns.
AllowDeleteRows Boolean optionalposition: namedpipeline: False
Allow deleting rows.
AllowFormatCells Boolean optionalposition: namedpipeline: False
Allow formatting cells.
AllowFormatColumns Boolean optionalposition: namedpipeline: False
Allow formatting columns.
AllowFormatRows Boolean optionalposition: namedpipeline: False
Allow formatting rows.
AllowInsertColumns Boolean optionalposition: namedpipeline: False
Allow inserting columns.
AllowInsertHyperlinks Boolean optionalposition: namedpipeline: False
Allow inserting hyperlinks.
AllowInsertRows Boolean optionalposition: namedpipeline: False
Allow inserting rows.
AllowPivotTables Boolean optionalposition: namedpipeline: False
Allow PivotTables.
AllowSelectLockedCells Boolean optionalposition: namedpipeline: False
Allow selecting locked cells.
AllowSelectUnlockedCells Boolean optionalposition: namedpipeline: False
Allow selecting unlocked cells.
AllowSort Boolean optionalposition: namedpipeline: False
Allow sorting.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after protection.
Sheet String optionalposition: namedpipeline: False
Worksheet name when using Document.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) when using Document.

Outputs

System.Object