VBA to load webnsite and pass details

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
 
A

Arvin Meyer [MVP]

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
 
D

Daniel Pineault

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top