IF OLE DB Connection Refresh All Window pop Up VBA Then...

dversloot1

Board Regular
Joined
Apr 3, 2013
Messages
113
Hello,

I've created dynamic Command Text within my OLE DB Connection that loops through row data to refresh table and perform a series of other macros. In instances where there isn't any data to be pulled, a window pops up saying: "The following data range failed to refresh: ..... Continue to refresh all?"

How do I create an if statement around this to skip this particular string and move on to the next?

Thanks,

Dan
 
My table refresh code is below. How can I add in the if statement around the alert message?


With ActiveWorkbook.Connections("LIST1").OLEDBConnection
.BackgroundQuery = False
.CommandText = MyStr
.Refresh

End With


Any help would be greatly appreciated!
 
Upvote 0

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