Terry_Orange
Board Regular
- Joined
- Jul 22, 2002
- Messages
- 133
Hi folks,
I have a web query set up in Excel (below). It works fine unless the webpage does not exist. Any ideas anyone how I can go about error trapping this ?
THANK YOU
TO.
I have a web query set up in Excel (below). It works fine unless the webpage does not exist. Any ideas anyone how I can go about error trapping this ?
THANK YOU
TO.
Code:
Sub ImportWebpage(ByVal PathName As String, ByVal PathNo As Integer)
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.the_website_I'm_accessing" & PathName & "file.asp", _
Destination:=Range("A1"))
.Name = PathName & "file"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With
End Sub