Overview
Script task to refresh Excel connections and pivot tables.
Setup
The script has the following parameters:
- IsFileVariable - If true, input Excel file name is contained in package variable. Otherwise, it is a file connection manager (Boolean).
- FileVariable - Input file variable (String).
- File - Input file connection manager (Connection).
- All - If true, all connections are refreshed (Boolean).
- Timeout - Specifies the time in seconds to wait for data to refresh before closing the Excel application. The default is 100 seconds (Integer).
- Connections - Explicitly select connections to refresh.
- Worksheets - Explicitly select worksheets to refresh.
Additional information
If you receive the following error:
Microsoft Excel cannot access the file '<path>.xlsx'. There are several possible reasons: ? The file name or path does not exist. ? The file is being used by another program. The workbook you are trying to save has the same name as a currently open workbook.
This issue can be resolved by adding a Desktop folder to the following directories:
- C:\Windows\SysWOW64\config\systemprofile\
- C:\Windows\System32\config\systemprofile\
Configuration
To use this script, you would need to load it in COZYROC JavaScript Task. If you are using COZYROC SSIS+ 2.0 or later, after selecting the corresponding script type and opening the component editor, you can select the script from a dropdown list with the pre-built scripts. For COZYROC SSIS+ 1.9, you can download the JavaScript file and browse to it via the "Import JavaScript code" button.
Excel_Refresh_Task.jsKnowledge Base
Related documentation
COZYROC SSIS+ Components Suite is free for testing in your development environment.
A licensed version can be deployed on-premises, on Azure-SSIS IR and on COZYROC Cloud.