Excel: handle error on data connection refresh

AndreaGua 1 Reputation point
2021-01-08T18:40:43.813+00:00

I have an Excel file with a data connection (olap cube), sometimes I can refresh it, but sometimes, randomly the refresh fails (maybe the data source is temporarily not available, I don't know why and unfortunately I don't have admin rights on this Microsoft SQL Server) and I receive these popups (Analysis Services wizard):

Z91iF.jpg

1 I click OK

UWmjC.jpg

2 I click Cancel

wxaAk.jpg

3 I click OK, then I try again to refresh successfully.

I need to run the refresh with a macro. So I call a refresh using vba and sometimes the connection fails (like when I manually refresh), I don't get any error in the code but the popups appear. How can I handle those manual 3 steps above using vba?

Developer technologies | Visual Basic for Applications
0 comments No comments
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.