VBA to load webnsite and pass details

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

have a acceess database for a shop and what to take payment via a
online terminal, i have the website address and log in detaits. I
have
got the following code however i alwasy get an error or "Dim iePage
As
HTMLDocument"

Any idea what could be causeing this


Private Sub Command0_Click()
Dim ieApp As InternetExplorer
Dim iePage As HTMLDocument
Set ieApp = New InternetExplorer
ieApp.Visible = True
ieApp.Navigate "https://live.sagepay.com/MySagePay/loginpage.asp"
'wait for page to load
Do Until ieApp.ReadyState = READYSTATE_COMPLETE
Loop
Set iePage = ieApp.Document
iePage.Forms(0).Item("vendorname").Value = "ABC Company"
iePage.Forms(0).Item("username").Value = "John"
iePage.Forms(0).Item("password").Value = "pass"
iePage.Forms(0).Item("login").Click


End Sub
 
Not sure of the exact error because to didn't post the error number, but it
may have to do with references. Try setting a reference to IE. From any code
window:

Tools >>> References
 
Simon,

please do not cross-post questions. You only need to post the question
once. this way everyone benefits from other people comments and
troubleshooting rather than making multiple people start from scratch to help
you when your question may already have been answer in another forum.

http://www.microsoft.com/office/com...&p=1&tid=fc238093-4f4b-43b5-92d9-dc1021ae2577
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
Back
Top