Bonaparte
12-07-2007, 11:41 PM
Hi, I'm trying to extract data from a website every 5 seconds interval.
Things are going well. However, sometimes when the server is busy, excel return with an error:
Unable to open:
<Website address>
Cannot locate the internet server or proxy server.
Is there a way to force the application to wait for abt 60 seconds, then
reconnect the the website automatically?
Mycodes:
Sub The_Sub()
Dim x As Long
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://www.soccernet.com", Destination _
:=Range("A1"))
.Name = "product-desc.php?auction=07B003D"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 1
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Worksheets("Sheet1").Cells(12, 3).Value = Time
Call GetLastUsedCell(2)
Sheet1.Activate
StartTimer
End Sub
Things are going well. However, sometimes when the server is busy, excel return with an error:
Unable to open:
<Website address>
Cannot locate the internet server or proxy server.
Is there a way to force the application to wait for abt 60 seconds, then
reconnect the the website automatically?
Mycodes:
Sub The_Sub()
Dim x As Long
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://www.soccernet.com", Destination _
:=Range("A1"))
.Name = "product-desc.php?auction=07B003D"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 1
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Worksheets("Sheet1").Cells(12, 3).Value = Time
Call GetLastUsedCell(2)
Sheet1.Activate
StartTimer
End Sub