Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim USER_NAME As String
- Dim PASS_WORD As String
- Dim IE As Object
- Dim Doc As Object, lastRow As Long, tblTR As Object
- Sub INIT()
- Website "init"
- End Sub
- Function Website(arg As String)
- If arg = "init" Then
- USER_NAME = "" 'username goes here
- PASS_WORD = "" ' password goes here
- Set IE = CreateObject("internetexplorer.application")
- IE.Visible = True
- navigate:
- IE.navigate "https://www.bqecore.com/webapp/"
- Do While IE.ReadyState <> 4: DoEvents: Loop
- Set Doc = CreateObject("htmlfile")
- Set Doc = IE.document
- If Doc Is Nothing Then GoTo navigate
- Set UserName = Doc.getelementbyid("Email")
- UserName.Value = USER_NAME
- Set password = Doc.getelementbyid("Password")
- password.Value = PASS_WORD
- Set signInBtn = Doc.getelementbyid("btnSignIn")
- signInBtn.Click
- wait 10
- IE.navigate "https://wap140.bqecore.com/webapp/TimeEntry/TimeEntry"
- wait 5
- Call NonBlockingChange
- End If
- If arg = "checkHours" Then
- Set Total = Doc.getElementsByClassName("totalCol")
- Cells(21, 2).Value = Total(0).Title
- End If
- End Function
- Sub wait(amount As Integer)
- Application.wait Now + TimeSerial(0, 0, amount)
- Do While IE.ReadyState <> 4: DoEvents: Loop
- End Sub
- Sub NonBlockingChange()
- Update
- Application.OnTime Now + TimeValue("0:00:01"), "NonBlockingChange"
- End Sub
- Sub Update()
- Website "checkHours"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement