Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

VBA to refresh Power Query

Dear members,

 

Thanks a lot for your time. I am using VBA to refresh power query embedded in Excel, but sometimes will got this error message. Anyone has encountered this situation before?

 

The VBA code: 

maggiekedq_3-1636089439994.png

 

The error message in VBA:

maggiekedq_2-1636089371904.png

 

The status in Power Query, seems refresh cannot be finished

maggiekedq_1-1636087719938.png

 

Best Regards,

Maggie

3 REPLIES 3
lbendlin
Super User
Super User

As the error message states - if a refresh is currently happening any additional refresh requests will be ignored until that refresh is complete.

Anonymous
Not applicable

Thank you for your response! Is there a way to stop the refresh without reopening the Excel? Usually it should be completed within several seconds, but sometimes the refresh of this query will take long time (cannot stop), so this error message pops up.

 

I would like to refresh this Query only, would not refresh other queries.

I am not aware of a way to stop an ongoing refresh, apart from stopping and restarting the capacity your dataset is on.

 

Have you looked into refreshing partitions via XMLA endpoint?

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.