Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por Diogenio
#51945
Prezados, boa noite

Consigo executar a maior parte da macro para acessar o site https://sitenet.serasa.com.br/Logon/.
Inseri o usuário a senha, tudo certo, mas não consigo programar o VBA para clicar no botão de acesso para o LOGIN

Ao inspecionar o elemento nesse visualizo:

<a id="acessar" href="#" class="btn btn-blue btn-block envia-form">Acessar</a>

O código que escrevi foi:

Sub ACESSO()

If Range("A" & ActiveCell.Row).Value = Empty Then
MsgBox "Por favor, preencha o número da conta!"
Exit Sub
Else
End If

If Range("B" & ActiveCell.Row).Value = Empty Then
MsgBox "Por favor, preencha o número da agência!"
Exit Sub
Else
End If

If Range("C" & ActiveCell.Row).Value = Empty Then
MsgBox "Por favor, preencha o número do cheque!"
Exit Sub
Else
End If

On Error Resume Next

If Rows(ActiveCell.Row).RowHeight > 0.1 Then
Range("K" & ActiveCell.Row).Select
Else
End If

Dim HTMLDoc As HTMLDocument
Dim oBrowser As InternetExplorer

Dim oHTML_Element As IHTMLElement
Dim sURL As String
On Error GoTo Err_Clear
sURL = "https://sitenet.serasa.com.br/Logon/"
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.LOGON.Value = "meu usuario"
HTMLDoc.all.SENHA.Value = "minha senha"

'''Nesse ponto não consigo desenolver
For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For

Err_Clear:

Resume Next

Label1.Text = e.X.toString()
Label2.Text = e.Y.toString()

End sub

Alguém pode me ajudar por favor?

Obrigado!
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord