1

The current Code in VBA is

 Option Explicit
 Sub login ()
 Dim i As SHDocVw.InternetExplorer
 Set i =New InternetExplorer
 i.Visible=True
 i.navigate ("https://insertconfidentialwebsitehere")
 Do while i.readystate <> READYSTATE_COMPLETE
 Loop
 Dim idoc As MSHTML.HTMLDocument
 Set idoc=i.document
 Idoc.all.USER.Value="username"
 idoc.all.password.value="password"
 End Sub

The website does load when I run but I get Automation error 440 and the username and password do not show up when I run the command.
I checked through the reference after inspecting element which is correct. It is USER and PASSWORD.
I'm not sure why those values are not filled in with the given code.

I have also made VBS code for this application and VBS works great with Send Keys. If the above code has nothing wrong with it could you find a way to implement VBS send keys with the VBA and maybe that would work?

I don't know why using idoc.all is not loading my credentials.

Geert Bellekens
  • 12,788
  • 2
  • 23
  • 50
  • Since the address of the site seems to be a big secret ... I suppose the input fields are linked to events you have to trigger. Please read the following: https://stackoverflow.com/questions/64647587/excel-vba-to-login-to-website-and-grab-tr-td-elements/64649318#64649318 – Zwenn Dec 09 '20 at 14:28

0 Answers0