iknowu99
Well-known Member
- Joined
- Dec 26, 2004
- Messages
- 1,158
- Office Version
- 2016
hello all,
i am getting the error
run-time error '-2146697211 *800c0005)'':
the system cannot locate the resource specified
when running the following:
my guess is because sometimes the internet connection doesnt always work, or the page loads too slow, but 'on error resume next' doesnt work because the line takes awhile to execute and then excel turns off
i believe i saw somewhere here (mrexcel) how to give specific commands a limited time to run. i dont rememeber how to do this though, or any other workaround >> help is appreciated
i am getting the error
run-time error '-2146697211 *800c0005)'':
the system cannot locate the resource specified
when running the following:
my guess is because sometimes the internet connection doesnt always work, or the page loads too slow, but 'on error resume next' doesnt work because the line takes awhile to execute and then excel turns off
i believe i saw somewhere here (mrexcel) how to give specific commands a limited time to run. i dont rememeber how to do this though, or any other workaround >> help is appreciated
Code:
Sub foobar()
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
strURL = "http://www.yahoo.com"
xmlhttp.Open "GET", strURL, False, "", ""
xmlhttp.Send 'freezes here often
RtnPage = xmlhttp.ResponseText
Set fs = CreateObject("Scripting.FileSystemObject")
Set ag = fs.CreateTextFile("C:\test.html", True)
ag.Writeline (RtnPage)
ag.Close
End Sub