Cmdlet
Set-OfficeExcelRefreshOnOpen
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:
ContextSet-OfficeExcelRefreshOnOpen [-Connections] [-Disable] [-NoSavePivotSourceData] [-PassThru] [-Path] <String> [-PivotTables] [-SavePivotSourceData] [<CommonParameters>]#Parameter set:
PathSet-OfficeExcelRefreshOnOpen [-Connections] [-Disable] -Document <ExcelDocument> [-NoSavePivotSourceData] [-PassThru] [-PivotTables] [-SavePivotSourceData] [<CommonParameters>]#Parameter set:
DocumentExamples
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, QueryTablePartCountSets workbook metadata through OfficeIMO so pivot caches refresh on open.
Parameters
- -Connections SwitchParameter
- Update workbook connection refresh-on-open metadata.
- -Disable SwitchParameter
- Disable refresh-on-open instead of enabling it.
- -NoSavePivotSourceData SwitchParameter
- Do not save pivot cache source data.
- -PassThru SwitchParameter
- Emit the update summary.
- -PivotTables SwitchParameter
- Update pivot cache refresh-on-open metadata.
- -SavePivotSourceData SwitchParameter
- Preserve pivot cache source data.
- -Path String
- Workbook path to update.
- -Document ExcelDocument
- 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.