Advertisement
KyleCypher

Core to Invoice

Apr 17th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     Dim USER_NAME As String
  2.     Dim PASS_WORD As String
  3.     Dim IE As Object
  4.     Dim Doc As Object, lastRow As Long, tblTR As Object
  5. Sub INIT()
  6. Website "init"
  7. End Sub
  8. Function Website(arg As String)
  9. If arg = "init" Then
  10.     USER_NAME = "" 'username goes here
  11.    PASS_WORD = "" ' password goes here
  12.  
  13.    
  14.     Set IE = CreateObject("internetexplorer.application")
  15.     IE.Visible = True
  16. navigate:
  17.     IE.navigate "https://www.bqecore.com/webapp/"
  18.  
  19.     Do While IE.ReadyState <> 4: DoEvents: Loop
  20.  
  21.     Set Doc = CreateObject("htmlfile")
  22.     Set Doc = IE.document
  23.  
  24.     If Doc Is Nothing Then GoTo navigate
  25.  
  26.     Set UserName = Doc.getelementbyid("Email")
  27.     UserName.Value = USER_NAME
  28.  
  29.     Set password = Doc.getelementbyid("Password")
  30.     password.Value = PASS_WORD
  31.    
  32.     Set signInBtn = Doc.getelementbyid("btnSignIn")
  33.     signInBtn.Click
  34.    
  35.     wait 10
  36.     IE.navigate "https://wap140.bqecore.com/webapp/TimeEntry/TimeEntry"
  37.     wait 5
  38.     Call NonBlockingChange
  39.     End If
  40.    
  41. If arg = "checkHours" Then
  42.     Set Total = Doc.getElementsByClassName("totalCol")
  43.     Cells(21, 2).Value = Total(0).Title
  44. End If
  45.  
  46. End Function
  47.  
  48. Sub wait(amount As Integer)
  49.     Application.wait Now + TimeSerial(0, 0, amount)
  50.     Do While IE.ReadyState <> 4: DoEvents: Loop
  51. End Sub
  52.  
  53. Sub NonBlockingChange()
  54.     Update
  55.     Application.OnTime Now + TimeValue("0:00:01"), "NonBlockingChange"
  56. End Sub
  57.  
  58. Sub Update()
  59.     Website "checkHours"
  60. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement