ALe
09-13-2006, 04:23 AM
I'm trying to access a web page with automatic filling of input text controls.
As you can see I can't find a solution to get the input texts.:dunno
here's my code taken by a kb entry. Thanx (project has reference to Microsoft HTML e Microsoft Internet Controls)
Sub IE_login()
Dim ie As InternetExplorer
Dim C
Dim ULogin As Boolean, ieForm
Dim aid As String, cu As String, pw As String
redo:
aid = Application.InputBox("Please enter aid", "VBAX username", Default:="3")
cu = Application.InputBox("Please enter your cu", "VBAX Password", Default:="T")
pw = Application.InputBox("Please enter your pw", "VBAX Password", Default:="M")
If aid = "" Or cu = "" Or pw = "" Then GoTo redo
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "http://www.brebanca.it/SIT/public/homebanca.jsp?sez=39"
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
ie.Navigate "https://extensivenew.bancalombarda.it/tesoreriaenti/breweb"
'Loop until ie page is fully loaded
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
'Look for password Form by finding test "Password"
Dim INP As HTMLInputElement
For Each INP In ie.Document.getElementsByTagName("INPUT")
If INP.Name = "txtCENT" Then INP.Value = aid
If INP.Name = "txtCOPR" Then INP.Value = cu
If INP.Name = "txtCPSW" Then INP.Value = pw
Next
If ULogin = False Then MsgBox "User is aleady logged in"
Set ie = Nothing
End Sub
As you can see I can't find a solution to get the input texts.:dunno
here's my code taken by a kb entry. Thanx (project has reference to Microsoft HTML e Microsoft Internet Controls)
Sub IE_login()
Dim ie As InternetExplorer
Dim C
Dim ULogin As Boolean, ieForm
Dim aid As String, cu As String, pw As String
redo:
aid = Application.InputBox("Please enter aid", "VBAX username", Default:="3")
cu = Application.InputBox("Please enter your cu", "VBAX Password", Default:="T")
pw = Application.InputBox("Please enter your pw", "VBAX Password", Default:="M")
If aid = "" Or cu = "" Or pw = "" Then GoTo redo
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "http://www.brebanca.it/SIT/public/homebanca.jsp?sez=39"
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
ie.Navigate "https://extensivenew.bancalombarda.it/tesoreriaenti/breweb"
'Loop until ie page is fully loaded
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
'Look for password Form by finding test "Password"
Dim INP As HTMLInputElement
For Each INP In ie.Document.getElementsByTagName("INPUT")
If INP.Name = "txtCENT" Then INP.Value = aid
If INP.Name = "txtCOPR" Then INP.Value = cu
If INP.Name = "txtCPSW" Then INP.Value = pw
Next
If ULogin = False Then MsgBox "User is aleady logged in"
Set ie = Nothing
End Sub