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
Outputs
System.Management.Automation.PSObject

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>]
#
Parameter set: Context
Set-OfficeExcelRefreshOnOpen [-Connections] [-Disable] [-NoSavePivotSourceData] [-PassThru] [-Path] <String> [-PivotTables] [-SavePivotSourceData] [<CommonParameters>]
#
Parameter set: Path
Set-OfficeExcelRefreshOnOpen [-Connections] [-Disable] -Document <ExcelDocument> [-NoSavePivotSourceData] [-PassThru] [-PivotTables] [-SavePivotSourceData] [<CommonParameters>]
#
Parameter set: Document

Examples

Authored help example

Refresh pivot caches when the workbook opens.

$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.