G
Guest
Hey,
I have a sight problem.
When I open the form, a procedure grabs the html from the page specified.
What I need is for this to happen every 20 minutes.
I threw in some code for the _timer event, and everything seemed fine. But.
When I checked the html that was grabbed, it was the exact same.
I even went as far as automatically closing the form, and opening it - as
well as launching internet explorer, loading the page, and then closing
it(all on the form_timer event) Nothing. It will not refresh.
But when I manually close the form and open it again ...the "latest" html
code is presented.
I was wondering if anyone would know how to go about and "refresh" the
procedure with the lastest html code?
Thanks.
-State
Here is the code:
=======/START CODE/========
Dim strUrl As String
Dim strHTML As String
' Initialize the URL to search
strUrl = "http://www.z1035.com/home/lastfive.php"
' Use our GetFromWebpage function to
' retrieve the HTML from the site
strHTML = GetFromWebpage(strUrl)
txtInput.SetFocus
txtInput.Text = ""
txtInput.Value = strHTML
--FUNCTION---
Function GetFromWebpage(URL As String) As String
Dim objWeb As Object
Dim strXML As String
' Instantiate an instance of the web object
Set objWeb = CreateObject("Microsoft.XMLHTTP")
' Pass the URL to the web object, and send the request
objWeb.Open "GET", URL, False
objWeb.Send
' Look at the HTML string returned
strXML = objWeb.responseText
GetFromWebpage = strXML
End Function
======/END CODE/=========
I have a sight problem.
When I open the form, a procedure grabs the html from the page specified.
What I need is for this to happen every 20 minutes.
I threw in some code for the _timer event, and everything seemed fine. But.
When I checked the html that was grabbed, it was the exact same.
I even went as far as automatically closing the form, and opening it - as
well as launching internet explorer, loading the page, and then closing
it(all on the form_timer event) Nothing. It will not refresh.
But when I manually close the form and open it again ...the "latest" html
code is presented.
I was wondering if anyone would know how to go about and "refresh" the
procedure with the lastest html code?
Thanks.
-State
Here is the code:
=======/START CODE/========
Dim strUrl As String
Dim strHTML As String
' Initialize the URL to search
strUrl = "http://www.z1035.com/home/lastfive.php"
' Use our GetFromWebpage function to
' retrieve the HTML from the site
strHTML = GetFromWebpage(strUrl)
txtInput.SetFocus
txtInput.Text = ""
txtInput.Value = strHTML
--FUNCTION---
Function GetFromWebpage(URL As String) As String
Dim objWeb As Object
Dim strXML As String
' Instantiate an instance of the web object
Set objWeb = CreateObject("Microsoft.XMLHTTP")
' Pass the URL to the web object, and send the request
objWeb.Open "GET", URL, False
objWeb.Send
' Look at the HTML string returned
strXML = objWeb.responseText
GetFromWebpage = strXML
End Function
======/END CODE/=========