Sub tela()
Dim ie As InternetExplorer
Dim frm
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "http://unilogvli/unilog/Index.asp?mode=logon"
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
%first page - login page
%commands to insert login parameters
ie.Document.getElementById("usuario").Value = ""
ie.Document.getElementById("senha").Value = ""
ie.Document.all("form1").submit
Do While ie.Busy
Loop
%second page - 115 link value of a page that i have to access
ie.Document.all("Link").Value = "115"
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
SendKeys "{ENTER}", True %sendkey command used to access the 115 link
SendKeys "{NUMLOCK}", True %after the sendkey used before numlock is turned off
Do While ie.Busy
Loop
%in the third page which is the one that i'm having trouble
%i have to access the field frota and put the value "00862"
%and after that i have to simulate the "ENTER" another time
%i thought in using the sendkey "{ENTER}" to do this
%and i had tried it but without success
%strangely it doesn't work like the previous page so i think
%that i'll have to use smth like "ie.document.all("form1").submit" again
%all the commands that i've used so far, without results for this third page:
' ie.Document.forms("form1").Document.all("frota").Value = "00862"
'Set frm = ie.Document.forms("form1")
' Set frm.elements("frota").Value = "00862"
' frm.elements("frota").Value = "00862"
' ie.Document.forms.Item("form1").Document.all("frota").Value = "00862"
' ie.Document.forms.form1(0).Value = "88"
' ie.Document.all("frota").Value = "00862"
' ie.Document.all("frota").submit
' Application.Wait (Now + TimeValue("00:00:03"))
' ie.Document.all("form1.frota").Value = "00862"
' objIE.Document.all("form1.frota.value").Value = "00862"
' ie.Document.getElementById("frota").Value = "00862"
%these are all the commands
Set ie = Nothing
End Sub