0
Hello, I found a code that enters a website and makes authentication. After that it is on the home page of the site. I wanted to put this code to enter another link, but without closing the Internet Explorer that is open and authenticated. First part of the code he enters the site and authenticates (I already have), second part he writes another link and is redirected, for example: https://stackoverflow.com/.
Follows the Code:
Sub Login()
Dim oHTML_Element As IHTMLElement
Dim sURL As String
Dim myURL As String
Dim URL As String
Dim objElement As Object
Dim IE As Object
Dim IEapp As Object
Dim enderecoDaUrl As String
On Error GoTo Err_Clear
sURL = "https://clientes.tray.com.br/?redirect=redirected"
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.loja.Value = Range("D4").Value
HTMLDoc.all.usuario.Value = Range("D2").Value
HTMLDoc.all.senha.Value = Range("D3").Value
For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For
Next
Err_Clear:
Resume Next
Sleep (5000)
'AQUI IRIA A SEGUNDA PARTE'
End Sub
After going to this second part, when entering the link, is automatically downloaded a file .zip... You have some other code to open this zip file that has been downloaded into another excel sheet that I am working on?
Thank you!