Advertisement
Guest User

Untitled

a guest
May 27th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. 'add the "Microsoft Internet Controls" reference in your VBA Project indirectly
  2. Set ie = CreateObject("InternetExplorer.Application")
  3. With ie
  4. .Visible = True
  5. .navigate ("https://online.nationalgridus.com/login/LoginActivate?applicurl=aHR0cHM6Ly9vbmxpbmUubmF0aW9uYWxncmlkdXMuY29tL2VzZXJ2aWNlX2VudQ==&auth_method=0")
  6. While ie.ReadyState <> 4
  7. DoEvents
  8. Wend
  9. Set username = .document.getElementById("uid") 'id of the username control (HTML Control)
  10. Set pwd = .document.getElementById("response") 'id of the password control (HTML Control)
  11. Set button = .document.getElementById("Submit") 'id of the button control (HTML Control)
  12. username.Value = "MasterAccountName1234"
  13. pwd.Value = "MasterAccountPassword1234"
  14. button.Click
  15. While ie.ReadyState <> 4
  16. DoEvents
  17. Wend
  18. End With
  19. Set ie = Nothing
  20. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement