S
Sean
I have a simple piece of code below that refresh's some web queries to
get stock prices. What I have encountered is that sometimes a
particular query will return an error (web page not available etc),
what I wish to do, is if that happens, just bypass the particular
query and move to the next one.
How would I incorporate that in to be code?
Sub GetLatestPrices()
Application.ScreenUpdating = False
Sheets("Web Prices").Activate
ActiveSheet.Visible = True
Range("A3").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Range("A14").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Range("A25").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Application.ScreenUpdating = True
End Sub
get stock prices. What I have encountered is that sometimes a
particular query will return an error (web page not available etc),
what I wish to do, is if that happens, just bypass the particular
query and move to the next one.
How would I incorporate that in to be code?
Sub GetLatestPrices()
Application.ScreenUpdating = False
Sheets("Web Prices").Activate
ActiveSheet.Visible = True
Range("A3").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Range("A14").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Range("A25").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Application.ScreenUpdating = True
End Sub