• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA snipped to avoid err msg while macro runs

Hello,

My requirement is to refresh data connections one by one to save time as it takes more when we run them together. There are possibilities that Server2 can be offline and I don't want that to stop the ongoing macro. Can anyone please provide a VBA snippet to overcome this?

Sample code:
ActiveWorkbook.Connections("ABCD_Custom").Refresh
ActiveWorkbook.Connections("Server2").Refresh
ActiveWorkbook.Connections("DUBLIN_CUSTOMPNL").Refresh
ActiveWorkbook.Connections("DUBLIN_GLOBALADDS").Refresh

Thanks,
Karthik
 
You could put the following line before the first Refresh line

Code:
On Error Resume Next

But it will still take a while for Excel to find an error
 
Back
Top