# Set-OfficeExcelDocumentProperty

Sets a built-in or application document property on an Excel workbook.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Outputs**

`OfficeIMO.Excel.ExcelDocument`

**Source**

[SetOfficeExcelDocumentPropertyCommand.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Excel/SetOfficeExcelDocumentPropertyCommand.cs#L26) 

Sets a built-in or application document property on an Excel workbook.

## Syntax

```
Set-OfficeExcelDocumentProperty
[-Custom]
[-Document <ExcelDocument>]
[-Name] <String>
[-PassThru]
[[-Value] <Object>]
[<CommonParameters>]
```

[#](#method-set-officeexceldocumentproperty-switchparameter-exceldocument-string-switchparameter-object)

Parameter set: `Default`

## Examples

### Set the document title

```powershell
Open-OfficeExcel -Path .\Reports\Q3-Sales.xlsx {
    Set-OfficeExcelDocumentProperty Title 'Q3 sales'
}
```

Sets the built-in Title property.

### Tag a workbook with custom metadata

```powershell
Open-OfficeExcel -Path .\Reports\Q3-Sales.xlsx {
    Set-OfficeExcelDocumentProperty -Name Owner -Value 'Sales Operations' -Custom
    Set-OfficeExcelDocumentProperty -Name Classification -Value 'Internal' -Custom
    Set-OfficeExcelDocumentProperty -Name ReviewDate -Value (Get-Date).AddMonths(6) -Custom
}
```

Adds owner, classification and review-date custom properties that document management can search.

## Parameters

**-Custom SwitchParameter optional**

Treat the property as a custom workbook property.

**-Document ExcelDocument optionalpipeline: True (ByValue)**

Workbook to update when provided explicitly.

**-Name String requiredposition: 0**

Property name to update.

**-PassThru SwitchParameter optional**

Emit the updated workbook.

**-Value Object optionalposition: 1**

Property value.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:F1FAC6FF8CF12D39857A1273855D26600C3B10941D4949B29EE3895633C8909F -->
