# Set-OfficeExcelRefreshOnOpen

Turns refresh-on-open on or off for pivot caches and connections.

Cmdlet 

Aliases: ExcelRefreshOnOpen

**Module**

`PSWriteOffice`

**Aliases**

`ExcelRefreshOnOpen`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Source**

[SetOfficeExcelRefreshOnOpenCommand.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Excel/SetOfficeExcelRefreshOnOpenCommand.cs#L30) 

Turns refresh-on-open on or off for pivot caches and connections.

## Syntax

```
Set-OfficeExcelRefreshOnOpen
[-Connections]
[-Disable]
[-Document <ExcelDocument>]
[-PassThru]
[-PivotTables]
[-SavePivotSourceData]
[<CommonParameters>]
```

[#](#method-set-officeexcelrefreshonopen-switchparameter-switchparameter-exceldocument-switchparameter-switchparameter-switchparameter)

Parameter set: `Default`

## Examples

### Refresh pivot tables on open

```powershell
Open-OfficeExcel -Path .\Reports\Sales-2026.xlsx {
    ExcelRefreshOnOpen -PivotTables
}
```

Makes Excel refresh every pivot cache when the workbook opens.

### Stop refreshing before archiving

```powershell
Open-OfficeExcel -Path .\Archive\Sales-2026-09.xlsx {
    ExcelRefreshOnOpen -PivotTables -Connections -Disable -PassThru
}
```

Turns off refresh-on-open for pivot tables and connections in a month-end copy, so the archived figures stay as they were.

## Parameters

**-Connections SwitchParameter optional**

Update workbook connection refresh-on-open metadata.

**-Disable SwitchParameter optional**

Disable refresh-on-open instead of enabling it.

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

Caller-owned workbook; omission uses the enclosing Excel content block.

**-PassThru SwitchParameter optional**

Emits the native result after the operation.

**-PivotTables SwitchParameter optional**

Update pivot cache refresh-on-open metadata.

**-SavePivotSourceData SwitchParameter optional**

Preserve pivot cache source data.

## 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:2161085E0A1036B71B7736C400E811E73EEA3B90187D4664BAE1B510C5B3234F -->
