Forum Discussion
Auto Refresh Power Query in Excel with Web Content Connection
- 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
That article was talking about not having to open the source file to refresh your current file. if you have the file open, you can refresh it every so many minutes, without having to click refresh and without having to open the source file. They're not saying that your data tables will update while the file is closed. I've never read that--even with VBA you have to open the file.
--Nate