`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 = "http://tdbsorsvr034/tdb-rcs-report/"
'sURL = "http://tdbsorsvr034/tdb-rcs-report/reports/management/"
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
HTMLdoc.all.j_username.Value = "BXIMENES"
HTMLdoc.all.j_password.Value = "123456"
HTMLdoc.all.loginBtnId.onclick
'HTMLdoc.all.[ui-menuitem-link ui-corner-all].Value = "PrimeFaces.ab({source:'j_id196380812_76b57a10:j_id196380812_76b57a92',formId:'j_id196380812_76b57a10'})"
For Each oHTML_Element In HTMLdoc.getElementsByTagName("input")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For
Next
Err_Clear:
Resume Next`
Dim oBrowser As InternetExplorer
Sub Login()
Dim oHTML_Element As IHTMLElement
Dim sURL As String
On Error GoTo Err_Clear
sURL = "http://tdbsorsvr034/tdb-rcs-report/"
'sURL = "http://tdbsorsvr034/tdb-rcs-report/reports/management/"
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
HTMLdoc.all.j_username.Value = "BXIMENES"
HTMLdoc.all.j_password.Value = "123456"
HTMLdoc.all.loginBtnId.onclick
'HTMLdoc.all.[ui-menuitem-link ui-corner-all].Value = "PrimeFaces.ab({source:'j_id196380812_76b57a10:j_id196380812_76b57a92',formId:'j_id196380812_76b57a10'})"
For Each oHTML_Element In HTMLdoc.getElementsByTagName("input")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For
Next
Err_Clear:
Resume Next`