Powershell Script – Open Excel, Update External Data, Save as

Question:

Is anyone able to help me with this script.

The workbook opens and updates its pivot table with external data through an ODBC connection. When you open the workbook manually it refreshes. When you open it with the script it just opens and does not refresh the data.

I have tried the following:

  • Checking the checkbox “Always use connection file”
  • Saving the password for the data source inside excel
  • Disabling “Enable background refresh” and all the other refresh options
  • Created a macro to automatically refresh the data source when the workbook opens

Any help would be appreciated, thanks!

Answer:

Change

to

Source:

Powershell Script – Open Excel, Update External Data, Save as by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply