Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi everyone,
I am sharing this question because I am a bit puzzled.
The question is not directly related to Power BI since it is about refreshing data loaded into an Excel worksheet from a PQ query, with VBA.
Situation
I am used to refresh data collected with Power Query from different sources into Excel worksheets using VBA. I used different methods to do so:
- Thisworkbook.Connections("query_name").OLEDBConnection.Refresh
- Sh.Listobjects("tbl_output_name").Querytable.Refresh
Recently, on one of my colleagues told that the "Querytable" of the second method was useless. He was used to refresh his own Excel output data from PQ Queries simply using : Sh.Listobjects("tbl_output_name").Refresh.
Question
Three different ways to refresh the same data : Is there a best way among these three ?
I assumed that the answer is "Yes". Then why is it the best ?
After that : what difference between Sh.Listobjects("tbl_output_name").Querytable.Refresh and Sh.Listobjects("tbl_output_name").Refresh in term of impacts and efficiency ?
Before posting here, I made some research with no success. The Documentation doesn't answer to these questions.
Thank you in advance for your lights.
Regards,
Hi @Anonymous ,
Please see if the document can help:
VBA to optimise Refresh and list all Connections with refresh time | MrExcel Message Board
QueryTable.Refresh method (Excel) | Microsoft Learn
ListObject.QueryTable property (Excel) | Microsoft Learn
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!