Any way to validate that Power Query refresh was successful?

cr731

Well-known Member
Joined
Sep 17, 2010
Messages
611
I'm using Power Query and usually just use Refresh All to refresh all of my queries, and I would say that about 20-30% of the time, the query does not refresh successfully for whatever reason (it's pulling from an Access database and I frequently get the "File in use" error, which seems to go away if I do a second refresh).

Anyhow, I am looking for some way to identify that the refresh failed ... I'm using VBA to run the .RefreshAll command, so if there is a VBA way to determine if a query's refresh was a success, that would be ideal.

I'm using Excel 2013.

Is this possible?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
How do you know it fails? If you know, why do you need a VBA solution? Just asking!

I know because if I open the Power Query pane, there is an exclamation next to the query saying that the Load to Data Model failed. Most often, if I attempt a refresh a second time, it works fine.

But I'd like a user friendly way to identify the refresh failure than having to open the pane and check each query.
 
Upvote 0
I can only think of a way to generate this data in your queries. I'm not aware that there are metadata (at least not before 2016) that you can access for Power Query.

So you could add a column containing "DateTime.LocalNow", filling in the current datetime when the query was refreshed.
Harvest them and compare them - if there are deviations above a certain threshold (5 mins?) show some red flags using conditional formatting.
 
Upvote 0

Forum statistics

Threads
1,224,155
Messages
6,176,736
Members
452,741
Latest member
Muhammad Nasir Mahmood

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top