Forum Discussion
IB_rewoP
1 year agoFrequent Visitor
Auto Refresh Power Query in Excel with Web Content Connection
hi community, I have a power query set up in excel that has a connection to web contents and I have set the query to refresh every 6 minutes and checked the enable background refresh. Also the q...
- 1 year ago
Hi IB_rewoP
Why It Doesn’t Work:
- Auto-refresh only works when the Excel file is open. Closing the file stops the refresh.
- "Enable Background Refresh" only allows Excel to continue working while refreshing but doesn’t apply when the file is closed.
Solution:
- Use VBA: Add this code to refresh when the file opens:
Private Sub Workbook_Open() ThisWorkbook.RefreshAll End Sub - Save the file as a macro-enabled workbook (.xlsm).
- Power Automate: Use it to refresh the file if stored in OneDrive/SharePoint.
- Query Properties: Right-click the query in Data > Queries & Connections, select Properties, and check:
- "Refresh every X minutes"
- "Refresh data when opening the file."
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
IB_rewoP
1 year agoFrequent Visitor
Did as you said by saving the Excel as a xlsm file with the VBA codes and using PA to refresh the file and it worked. However I am not sure if my organisation likes xlsm files. I've also created another solution without VBA using Power Automate, for anyone interested sharing the video: https://www.youtube.com/watch?v=4Qoh9t_ZvqI