basil3legs
Programmer
Hi,
Through an Excel 2000 Macro, I am opening a list of webpages through a Query. However, some of the pages do not always exist and hence the Macro crashes with a "Runtime error '1004' Unable to open....". I am trying to capture this error and jump to the next page on the list but it is still crashing when it hits the first page that doesn't exist.
The code I have is :
Any help will be greatly appreciated. Thank.
Through an Excel 2000 Macro, I am opening a list of webpages through a Query. However, some of the pages do not always exist and hence the Macro crashes with a "Runtime error '1004' Unable to open....". I am trying to capture this error and jump to the next page on the list but it is still crashing when it hits the first page that doesn't exist.
The code I have is :
Code:
With Selection.QueryTable
.Connection = Worksheets("Page1").Cells(URLLine, 1).Value
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingAll
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = True
End With
On Error GoTo JUMP
Selection.QueryTable.Refresh BackgroundQuery:=False
Code for when page exists
JUMP:
On Error GoTo 0
Any help will be greatly appreciated. Thank.