AndrewKent
Well-known Member
- Joined
- Jul 26, 2006
- Messages
- 889
Hi there,
I started a thread a while back but didn't get any answers on it, probably because I wasn't explicit enough about the issues I was facing. The coding seen below works fine 90% of the time, but occasionally it will freeze. It's always at the same place, the line after the status "Step 3 of 5":
This is the line that activates the function:
which could contain a link like this:
http://msn.foxsports.com/foxsoccer/mls/scores?week=23&timeframe=1
Can anyone recommend some sort of time out update that if a connection cannot be made after a few seconds that the program waits, then tries again?
Kind regards,
Andy
I started a thread a while back but didn't get any answers on it, probably because I wasn't explicit enough about the issues I was facing. The coding seen below works fine 90% of the time, but occasionally it will freeze. It's always at the same place, the line after the status "Step 3 of 5":
Code:
Function GetSource(sURL As String) As String
' =============================================================================================
' =============================================================================================
On Error GoTo NoData
Dim oXHTTP As Object
Application.StatusBar = "Retrieving Source Code (Step 1 of 5), please wait..."
Set oXHTTP = CreateObject("MSXML2.XMLHTTP")
Application.StatusBar = "Retrieving Source Code (Step 2 of 5), please wait..."
oXHTTP.Open "GET", sURL, False
Application.StatusBar = "Retrieving Source Code (Step 3 of 5), please wait..."
oXHTTP.send
Application.StatusBar = "Retrieving Source Code (Step 4 of 5), please wait..."
GetSource = oXHTTP.responsetext
Application.StatusBar = "Retrieving Source Code (Step 5 of 5), please wait..."
Set oXHTTP = Nothing
NoData:
End Function
This is the line that activates the function:
Code:
strSourceCode = GetSource("" & strFS_ActiveAddress & "")
which could contain a link like this:
http://msn.foxsports.com/foxsoccer/mls/scores?week=23&timeframe=1
Can anyone recommend some sort of time out update that if a connection cannot be made after a few seconds that the program waits, then tries again?
Kind regards,
Andy