Hi!
I want to login in a website, but first i have to select an option, and i'm not being successful.
This is the website: https://servicosonline.cpfl.com.br/agencia-webapp/#/login
And i want to select "cnpj". Can somebody help me? thanks
The code that i am using:
Dim htmlDoc As HTMLDocument
Dim oBrowser As InternetExplorer
Sub Login()
Dim oHTML_Element As IHTMLElement
Dim sURL As String
On Error GoTo Err_Clear
sURL = "https://servicosonline.cpfl.com.br/agencia-webapp/#/login"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.timeout = 60
oBrowser.navigate sURL
oBrowser.Visible = True
Do
Loop Until oBrowser.readyState = READYSTATE_COMPLETE
Set htmlDoc = oBrowser.document
IE.document.getElementById("SelectCnpj").Click
htmlDoc.all.DocumentoCnpj.Value = "cnpj"
htmlDoc.all.seuCodigo.Value = "UC"
For Each oHTML_Element In htmlDoc.getElementsByTagName("input")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For
Next
Err_Clear:
Resume Next
End Sub
I want to login in a website, but first i have to select an option, and i'm not being successful.
This is the website: https://servicosonline.cpfl.com.br/agencia-webapp/#/login
And i want to select "cnpj". Can somebody help me? thanks
The code that i am using:
Dim htmlDoc As HTMLDocument
Dim oBrowser As InternetExplorer
Sub Login()
Dim oHTML_Element As IHTMLElement
Dim sURL As String
On Error GoTo Err_Clear
sURL = "https://servicosonline.cpfl.com.br/agencia-webapp/#/login"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.timeout = 60
oBrowser.navigate sURL
oBrowser.Visible = True
Do
Loop Until oBrowser.readyState = READYSTATE_COMPLETE
Set htmlDoc = oBrowser.document
IE.document.getElementById("SelectCnpj").Click
htmlDoc.all.DocumentoCnpj.Value = "cnpj"
htmlDoc.all.seuCodigo.Value = "UC"
For Each oHTML_Element In htmlDoc.getElementsByTagName("input")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For
Next
Err_Clear:
Resume Next
End Sub