Oct 22 2021 12:37 AM - edited Oct 25 2021 12:45 AM
Hi,
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:
Aug 02 2022 04:03 AM
Aug 02 2022 07:03 AM
@PDTaylor Currently, pivot table refresh/Power Query refresh is not supported with Office Scripts. If you would like to see this feature in the Office Scripts feature-set, please upvote this request here: Enable Office Scripts to refresh Power Query queries · Community (microsoft.com).
Oct 25 2022 04:19 PM
Nov 15 2023 07:28 AM
I used your code and it did not work
I did not get an error message but the pivot table just did not refresh
by adding () at the end and it works
sample code
Jul 22 2024 02:12 PM
It depends on do we speak about Excel desktop or Excel for web.
On desktop workbook.refreshAllDataConnections() works the same way as Refresh All button.
On web only connections to the sources in the same file or anonymous ODate are refreshed. Why so and could it be resolved is in comments to Power Query Refresh is now generally available in Excel for the web (microsoft.com)