Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Set-OfficeExcelRefreshOnOpen

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

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

Syntax

Set-OfficeExcelRefreshOnOpen
[-Connections]
[-Disable]
[-Document <ExcelDocument>]
[-PassThru]
[-PivotTables]
[-SavePivotSourceData]
[<CommonParameters>]
#
Parameter set: Default

Examples

Refresh pivot tables on open

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

Makes Excel refresh every pivot cache when the workbook opens.

Stop refreshing before archiving

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.