VBA to create an error message when any Power Pivot connection fails on refresh

crsmith3

New Member
Joined
Jun 15, 2020
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
Hi,

I have a workbook that is connected to my BI database through Power Pivot. I have some VBA which refreshes all the connections & creates the workbook. I would like some VBA that brings up an error message if one of the connections fails to refresh - similar to if I was to refresh through 'data', 'refreshAll'.

At the minute the end user doesn't know if the refresh has been successful or not. for example, if i was to disconnect for my organisations network and refreshed through 'data', 'refreshAll' i get the following error message

1592230094877.png


Whereas when i process my macro, there is no error message and as far as the end user is concerned the workbook has refreshed. The VBA refresh i am using is 'ThisWorkbook.RefreshAll'

Thanks,
Chris
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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