Clicar com o mouse ou apertar enter
Enviado: Seg Set 23, 2019 7:22 pm
Boa noite,
Pessoal, gostaria da ajuda de voces com um código..
O código abaixo não está clicando com o mouse no botão "Cadastrar"
------Set objElementCol = IE.document.getElementsByTagName("input")
For Each objElement In objElementCol
If objElement.Value = "Cadastrar" Then
bjElement.Click-------
O comando não da erro, mas também não acontece nada!
Por gentileza, vocês teriam uma forma de contornar isso?
Segue código completo:
Sub Cotação()
Dim MyDate
Dim IE As Object
Set IE = CreateObject("InternetExplorer.application")
With IE
.Visible = True
.NAVIGATE ("https://servicos.gollog.com.br/Home/Inicio#cotacao")
While .Busy Or .readyState <> 4:
DoEvents:
Wend
IE.document.getElementById("select_data").Value = Range("F8")
IE.document.getElementById("input_cotacao").Value = Range("C6")
IE.document.getElementById("input_destino").Value = Range("C22")
IE.document.getElementById("input_cotacao_2").Value = ("1")
IE.document.getElementById("input_destino_1").Value = Range("C8")
IE.document.getElementById("select_produto").Value = Range("F6")
IE.document.getElementById("input_entrega").Click
Set target = Range("G15")
If target.Value = "SIM" Then
IE.document.getElementById("input_valor_nota").Value = Range("F15")
IE.document.getElementById("input_seguro").Click
End If
IE.document.getElementById("quote").Click
On Error GoTo Invalido
IE.document.getElementById("input_name").Value = ("Marcos")
IE.document.getElementById("input_phone").Value = ("(99) 9999-99999")
IE.document.getElementById("input_email").Value = ("marcos.abreu@spharmu.com.br")
IE.document.getElementById("input_company").Value = ("SPecial Pharmus")
Dim objElementCol As Object
Dim objElement As Object
Set objElementCol = IE.document.getElementsByTagName("input")
For Each objElement In objElementCol
If objElement.Value = "Cadastrar" Then
bjElement.Click
Exit For
End If
Next objElement
Invalido:
MsgBox "Valor disponível"
While .Busy Or .readyState <> 4:
DoEvents:
Wend
End With
End Sub
Pessoal, gostaria da ajuda de voces com um código..
O código abaixo não está clicando com o mouse no botão "Cadastrar"
------Set objElementCol = IE.document.getElementsByTagName("input")
For Each objElement In objElementCol
If objElement.Value = "Cadastrar" Then
bjElement.Click-------
O comando não da erro, mas também não acontece nada!
Por gentileza, vocês teriam uma forma de contornar isso?
Segue código completo:
Sub Cotação()
Dim MyDate
Dim IE As Object
Set IE = CreateObject("InternetExplorer.application")
With IE
.Visible = True
.NAVIGATE ("https://servicos.gollog.com.br/Home/Inicio#cotacao")
While .Busy Or .readyState <> 4:
DoEvents:
Wend
IE.document.getElementById("select_data").Value = Range("F8")
IE.document.getElementById("input_cotacao").Value = Range("C6")
IE.document.getElementById("input_destino").Value = Range("C22")
IE.document.getElementById("input_cotacao_2").Value = ("1")
IE.document.getElementById("input_destino_1").Value = Range("C8")
IE.document.getElementById("select_produto").Value = Range("F6")
IE.document.getElementById("input_entrega").Click
Set target = Range("G15")
If target.Value = "SIM" Then
IE.document.getElementById("input_valor_nota").Value = Range("F15")
IE.document.getElementById("input_seguro").Click
End If
IE.document.getElementById("quote").Click
On Error GoTo Invalido
IE.document.getElementById("input_name").Value = ("Marcos")
IE.document.getElementById("input_phone").Value = ("(99) 9999-99999")
IE.document.getElementById("input_email").Value = ("marcos.abreu@spharmu.com.br")
IE.document.getElementById("input_company").Value = ("SPecial Pharmus")
Dim objElementCol As Object
Dim objElement As Object
Set objElementCol = IE.document.getElementsByTagName("input")
For Each objElement In objElementCol
If objElement.Value = "Cadastrar" Then
bjElement.Click
Exit For
End If
Next objElement
Invalido:
MsgBox "Valor disponível"
While .Busy Or .readyState <> 4:
DoEvents:
Wend
End With
End Sub