Hi,
I have the code below to log in to website automatically by getting username, password from cells in a spreadsheet, problem having is that when click and goes to website
filled in the password in the box from cell F20 but not in the Login box that should get it from cell E20 (The line in red is not working ), please help what I am doing wrong.
here is the code:
I have the code below to log in to website automatically by getting username, password from cells in a spreadsheet, problem having is that when click and goes to website
filled in the password in the box from cell F20 but not in the Login box that should get it from cell E20 (The line in red is not working ), please help what I am doing wrong.
here is the code:
Code:
Sub mt()Dim HTMLDoc As HTMLDocument
Dim MyBrowser As InternetExplorer
Dim WS As Worksheet
Dim MyHTML_Element As IHTMLElement
Dim MyURL As String
On Error GoTo Err_Clear
MyURL = "https://onlinebillmanager.globysonline.com/cv/scripts/B3B0/eng/log.asp?gru=204948601"
Set MyBrowser = New InternetExplorer
MyBrowser.Silent = True
MyBrowser.navigate MyURL
MyBrowser.Visible = True
Do
Loop Until MyBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = MyBrowser.document
[COLOR=#ff0000]HTMLDoc.all.login.Value = Worksheets("Sheet1").Range("E20")[/COLOR] 'Enter your email id here
HTMLDoc.all.Password1.Value = Worksheets("Sheet1").Range("F20") 'Enter your password here
For Each MyHTML_Element In HTMLDoc.getElementsByTagName(“input”)
If MyHTML_Element.Type = “loging” Then MyHTML_Element.Click: Exit For
Next
Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
End Sub