API Reference
Cmdlet
Set-OfficeExcelRefreshOnOpen
Configures workbook data refresh metadata for Excel-compatible applications to run when the file opens.
Remarks
Configures workbook data refresh metadata for Excel-compatible applications to run when the file opens.
Examples
Refresh pivot caches when the workbook opens.
PS>
$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.
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.
Syntax
Set-OfficeExcelRefreshOnOpen [-Connections] [-Disable] [-NoSavePivotSourceData] [-PassThru] [-PivotTables] [-SavePivotSourceData] [<CommonParameters>]#Parameter set:
ContextParameters
- 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.
Outputs
System.Management.Automation.PSObject
Set-OfficeExcelRefreshOnOpen [-Connections] [-Disable] -InputPath <String> [-NoSavePivotSourceData] [-PassThru] [-PivotTables] [-SavePivotSourceData] [<CommonParameters>]#Parameter set:
PathParameters
- Connections SwitchParameter
- Update workbook connection refresh-on-open metadata.
- Disable SwitchParameter
- Disable refresh-on-open instead of enabling it.
- InputPath String
- Workbook path to update.
- 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.
Outputs
System.Management.Automation.PSObject
Set-OfficeExcelRefreshOnOpen [-Connections] [-Disable] -Document <ExcelDocument> [-NoSavePivotSourceData] [-PassThru] [-PivotTables] [-SavePivotSourceData] [<CommonParameters>]#Parameter set:
DocumentParameters
- Connections SwitchParameter
- Update workbook connection refresh-on-open metadata.
- Disable SwitchParameter
- Disable refresh-on-open instead of enabling it.
- Document ExcelDocument
- Workbook to update outside the DSL context.
- 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.
Outputs
System.Management.Automation.PSObject