I tried to use VBA to refresh a query (on another excel spreadsheet) wit the code below:
Application.ScreenUpdating = False
On Error Resume Next
Selection.ListObject.TableObject.Refresh
ActiveWorkbook.Connections("Query - tbl_PRODLIST").Refresh
Application.ScreenUpdating = True
If the workbook is opened of a computer that does not have the spreadsheet from which the refresh is necessary, the refresh should not return an error but continue without refreshing the query. How can I prevent the error message ("Connection can not be refreshed") from appearing on screen?
Error checking is not my strongest point in VBA.
Thank for any help regarding this issue.
Ron
Bookmarks