Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeExcelProtectionOptions

Module
PSWriteOffice
Inputs
None
Outputs
PSWriteOffice.Services.OfficeProtectionExcelOptions

Creates Excel-specific hash and reservation settings for Protect-OfficeDocument.

Syntax

New-OfficeExcelProtectionOptions
[-LegacyPasswordHash <String>]
[-ModifyPasswordHash <String>]
[-ReservedBy <String>]
[<CommonParameters>]
#
Parameter set: Default

Examples

Set the name displayed by Excel for a protected write reservation.

$options = New-OfficeExcelProtectionOptions -ReservedBy 'Finance team'
Protect-OfficeDocument -Path ./Budget.xlsx -Restriction ReadOnlyRecommended -Options $options -OutputPath ./Budget-review.xlsx

Parameters

-LegacyPasswordHash String optional
Precomputed native workbook protection hash, with at most four hexadecimal digits.
-ModifyPasswordHash String optional
Precomputed native write-reservation hash, with at most four hexadecimal digits.
-ReservedBy String optional
Name displayed by Excel for the write reservation.

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.

Outputs

PSWriteOffice.Services.OfficeProtectionExcelOptions: Shell options for the Excel protection vocabulary in the cross-format command.