get Http post response

  • Thread starter Thread starter Penstar
  • Start date Start date
P

Penstar

I have the following code to retrieve a balance off a web page

Set ie = CreateObject("InternetExplorer.Application")
HttpString = "http://www.test.com.au/gateway/creditpost.cfm?user=" &
User & "&pass=" & Pass & "&type=BG"
ie.navigate HttpString
'Msg"break"
getresponse = ie.Document.body.innerText
MsgBox ("Current Balance is " & getresponse)

I can only get the code to work by using a message box to pause until the
Internet explorer page is loaded.

How do I do this properly. i.e. tell my code to wait until IE page is loaded
before "getresponse"?

Thanks
Penny
 
I found a solution to my problem in another post

Setup Module with
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

In my procedure called Sleep
Call Sleep 4000

Works a treat
 
Back
Top