Advertisement
Guest User

Untitled

a guest
Jul 7th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. [CODE]
  2. Dim oIe As InternetExplorer
  3. Dim User, Pass As String
  4. Dim Loaded As Boolean
  5. Dim Cnt As Variant
  6. Dim oCell As Object
  7.  
  8. User = Sheet2.Cells(35, 5).Value
  9. Pass = Sheet2.Cells(35, 6).Value
  10.  
  11. If User = "" Or Pass = "" Then
  12. MsgBox "Credentials are not entered.", vbCritical, "Dumbass"
  13. Sheet2.Cells(35, 6).Select
  14. End If
  15.  
  16.  
  17.  
  18. Set oIe = FindIE("https://www.firstcommunityexpressnet.com/tob/live/usp-core/app/home")
  19.  
  20.  
  21. If oIe Is Nothing Then
  22. Set oIe = New InternetExplorer
  23. oIe.Visible = True
  24. oIe.navigate ("https://www.firstcommunity.com/home.html")
  25. 'wait for page to load
  26. Call SleepIE(oIe)
  27. PauseApp 3000
  28. 'loaded, now login.
  29. oIe.document.all.Item("username").Select
  30. oIe.document.all.Item("username").Value = User
  31. oIe.document.all.Item("password").Select
  32. oIe.document.all.Item("password").Value = Pass
  33. oIe.document.all.Item("oblSubmit").Click
  34. Call SleepIE(oIe)
  35. PauseApp 3000
  36. ' oIe.document.all.Item("ext-gen1020").Click
  37. Call SleepIE(oIe)
  38. PauseApp 1000
  39. End If
  40.  
  41. 'Trying to determine if I'm in the correct html container using this loop.
  42. Cnt = 0
  43. With oIe.document.frames("0").document.all ''''''''''Here is where the error occurs.
  44. For Each oCell In .tags("div")
  45. Debug.Print oCell.innerText
  46. Cnt = Cnt + 1
  47. Next oCell
  48. End With
  49. Set oCell = Nothing
  50. '''''
  51.  
  52. ''Things I've tried
  53. 'oIe.document.frames("0").document.body 'Same Error
  54. 'oIe.document.frames("main").document.all 'Same Error
  55. 'oIe.document.frames("main").document.body 'Same Error
  56. 'oIe.document.all ' This works, but doesn't navigate into the iframe. So it doesn't contain the data we need.
  57.  
  58.  
  59. [/CODE]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement