Excel Script - Refresh data

Occasional Visitor



I have an excel file which has a data connection. I have been trying to get the data and associated pivot tables to refresh through a script but it doesn't seem to work fully. The script is as follows:


function main(workbook: ExcelScript.Workbook) {
  // Refresh all data connections


I am prompting the script to run through PowerAutomate a couple of times a day. The file will appear to be modified (last modified date of file reflects when the script was last run through PowerAutomate) but the data in the Pivot table is not up to date from the data source.
If I open the file online will get a message to enable the queries so I don't know if this needs to be part of the script too?


Any thoughts? 
0 Replies