Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Set-OfficeExcelWriteReservation

Aliases: ExcelWriteReservationSet
Module PSWriteOffice
Aliases
ExcelWriteReservationSet
Inputs
OfficeIMO.Excel.ExcelDocument

Sets workbook write-reservation metadata.

Syntax

Set-OfficeExcelWriteReservation [-LegacyPasswordHash <String>] [-PassThru] [-Password <String>] [-ReadOnlyRecommended] [-UserName <String>] [<CommonParameters>]
#
Parameter set: Context
Set-OfficeExcelWriteReservation [-LegacyPasswordHash <String>] [-PassThru] [-Password <String>] [-Path] <String> [-ReadOnlyRecommended] [-UserName <String>] [<CommonParameters>]
#
Parameter set: Path
Set-OfficeExcelWriteReservation -Document <ExcelDocument> [-LegacyPasswordHash <String>] [-PassThru] [-Password <String>] [-ReadOnlyRecommended] [-UserName <String>] [<CommonParameters>]
#
Parameter set: Document

Examples

Authored help example

Recommend read-only opening for a shared workbook.

Set-OfficeExcelWriteReservation -Path .\Report.xlsx -ReadOnlyRecommended -UserName 'Reporting Team' -PassThru |
                Format-List ReadOnlyRecommended, UserName

Writes Excel file-sharing/write-reservation metadata without encrypting the file or protecting workbook structure.

Parameters

-LegacyPasswordHash String optional
Optional precomputed legacy write-reservation hash.
-PassThru SwitchParameter optional
Emit the updated write-reservation metadata.
-Password String optional
Optional write-reservation password. This is legacy Excel metadata, not package encryption.
-ReadOnlyRecommended SwitchParameter optional
Recommend opening the workbook as read-only.
-UserName String optional
User name stored in the write-reservation metadata.
-Path String requiredposition: 0aliases: FilePath, FullName, InputPathsets: Path
Workbook path to update.
-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document
Open workbook document to update.

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.