Advertisement
Guest User

Untitled

a guest
Nov 6th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim IEexp As InternetExplorer
  2. Set IEexp = New InternetExplorer
  3. IEexp.Visible = True
  4. IEexp.Navigate ("https://secure.edomero.defra.gov.uk/Default.aspx?Menu=Menu&Module=SecureHome")
  5. Do While IEexp.ReadyState <> 4: DoEvents: Loop
  6.  
  7. Application.Wait Now + #12:00:05 AM# 'added a wait to see if it loaded correctly
  8.  
  9. Dim inputElement As HTMLInputElement
  10. Set inputElement = IEexp.Document.getElementById("myHolder_Step2_txtUserName")
  11. inputElement.Value = "Username"
  12.  
  13. Application.Wait Now + #12:00:05 AM# 'added a wait to see if it loaded correctly
  14.  
  15. Set inputElement = IEexp.Document.getElementById("myHolder_Step2_txtPassword")
  16. inputElement.Value = "Password"
  17.  
  18. Application.Wait Now + #12:00:05 AM# 'added a wait to see if it loaded correctly
  19.  
  20. Application.SendKeys ("{TAB}")
  21. Application.Wait Now + #12:00:01 AM# 'added a wait to see if it loaded correctly
  22.  
  23. Application.SendKeys ("{TAB}")
  24. Application.Wait Now + #12:00:01 AM# 'added a wait to see if it loaded correctly
  25.  
  26. Application.SendKeys ("{TAB}")
  27. Application.Wait Now + #12:00:01 AM# 'added a wait to see if it loaded correctly
  28.  
  29. Application.SendKeys ("{TAB}")
  30. Application.Wait Now + #12:00:01 AM# 'added a wait to see if it loaded correctly
  31.  
  32. Application.SendKeys ("{TAB}")
  33. Application.Wait Now + #12:00:01 AM# 'added a wait to see if it loaded correctly
  34.  
  35.  
  36. Application.SendKeys ("~") 'press enter
  37.  
  38. 'IEexp.Document.getElementById("myHolder_Navigation_btnNext").Click
  39.  
  40.  
  41. Set IExp = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement