Posts

Showing posts from March 7, 2019

How to check whether Connection Refresh was successful

Image
1 In Excel 2016 VBA, I'm refreshing several queries like this: MyWorkbook.Connections(MyConnectionName).Refresh After the code is done, and no errors are encountered, I see that the hourglass icons for most of the queries are still spinning for several seconds. Is it possible to check for success AFTER all the refreshes are completed? I'm concerned that my code isn't going to know if an error happens after the code finishes but before the queries are done refreshing. BTW I don't want to do a RefreshAll, because some of the queries are dependent on others (uses them as a source). I refresh them in a certain sequence so that dependent queries are refreshed after the queries they are dependent on. UPDATE: I see that the Connection objects have a read-only RefreshDate property, which at fir