VBA to open website and pass details

S

Simon

I 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
 

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