# Set-OfficeExcelRefreshOnOpen

Configures workbook data refresh metadata for Excel-compatible applications to run when the file opens.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: ExcelRefreshOnOpen

**Module**

`PSWriteOffice`

**Aliases**

`ExcelRefreshOnOpen`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Outputs**

`System.Management.Automation.PSObject`

**Source**

[SetOfficeExcelRefreshOnOpenCommand.cs:19](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/SetOfficeExcelRefreshOnOpenCommand.cs#L19) 

Configures workbook data refresh metadata for Excel-compatible applications to run when the file opens.

## Syntax

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

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

Parameter set: `Context`

```
Set-OfficeExcelRefreshOnOpen
[-Connections]
[-Disable]
[-NoSavePivotSourceData]
[-PassThru]
[-Path] <String>
[-PivotTables]
[-SavePivotSourceData]
[<CommonParameters>]
```

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

Parameter set: `Path`

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

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

Parameter set: `Document`

## Examples

### Refresh pivot caches when the workbook opens.

```powershell
$refresh = Set-OfficeExcelRefreshOnOpen -Path .\Report.xlsx -PivotTables -Connections -NoSavePivotSourceData -PassThru
Get-OfficeExcelDataModel -Path .\Report.xlsx |
    Select-Object ConnectionPartCount, QueryTablePartCount
```

Sets workbook metadata through OfficeIMO so pivot caches refresh on open.

## Parameters

**-Connections SwitchParameter optional**

Update workbook connection refresh-on-open metadata.

**-Disable SwitchParameter optional**

Disable refresh-on-open instead of enabling it.

**-NoSavePivotSourceData SwitchParameter optional**

Do not save pivot cache source data.

**-PassThru SwitchParameter optional**

Emit the update summary.

**-PivotTables SwitchParameter optional**

Update pivot cache refresh-on-open metadata.

**-SavePivotSourceData SwitchParameter optional**

Preserve pivot cache source data.

**-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path**

Workbook path to update.

**-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document**

Workbook to update outside the DSL context.

## 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).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:525A26761EB1D66B470BA60E6EFBAA9E322CD48BA52B0E2543FA7709F1B83875 -->
