Guest User

Untitled

a guest
Jan 19th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. DoEvents
  2. WebAddress = "CONFIDENTIAL URL HERE" & WebID & "&t="
  3.  
  4. Dim IE As Object
  5.  
  6. Application.ScreenUpdating = False
  7. Application.Calculation = xlCalculationManual
  8.  
  9.  
  10. Set IE = CreateObject("InternetExplorer.Application")
  11.  
  12. IE.Navigate WebAddress
  13. IE.Visible = True
  14. While IE.busy
  15. DoEvents 'wait until IE is done loading page.
  16. Wend
  17.  
  18. Application.Wait (Now + TimeSerial(0, 0, 4))
  19.  
  20. IE.Document.All("Response_123").Value = ThisWorkbook.Sheets("Sheet1").Range("B5")
  21.  
  22. Dim IE As Object
  23.  
  24. Sub demo()
  25. Application.ScreenUpdating = False
  26.  
  27. Set IE = CreateObject("InternetExplorer.Application")
  28. IE.Visible = True
  29. IE.Navigate "C:UsersAdministratorDesktopsample.html"
  30.  
  31.  
  32. While IE.Busy
  33. DoEvents
  34. Wend
  35.  
  36. wait 1
  37. IE.Document.getElementById("firstname").Value = ThisWorkbook.Sheets("Sheet1").Range("A1")
  38. wait 1
  39. IE.Document.getElementById("lastname").Value = ThisWorkbook.Sheets("Sheet1").Range("A2")
  40. wait 1
  41. IE.Document.getElementById("submit_btn").Click
  42.  
  43. IE.Quit
  44. Set IE = Nothing
  45.  
  46. Application.ScreenUpdating = True
  47. End Sub
  48.  
  49. Private Sub wait(seconds As Long)
  50. Dim endTime As Date
  51. endTime = DateAdd("s", seconds, Now())
  52. Do While Now() < endTime
  53. DoEvents
  54. Loop
  55.  
  56. End Sub
Add Comment
Please, Sign In to add comment