1
I’m adapting VBA code for scraping, but I’m getting this message when it comes to sending the data to the Login form.
Runtime Error 438: Object does not accept property or Methods
Public Sub VBA_extrair()
Dim wb As Workbook: Set wb = ThisWorkbook
Dim wsParam As Worksheet: Set wsParam = wb.Worksheets("Param")
Dim IE As Object: Set IE = New InternetExplorer.Application
Dim stUsuario As String: stUsuario = wsParam.Range("A2")
Dim stSenha As String: stSenha = wsParam.Range("B2")
With IE
.Visible = True
.navigate "https://www.canalcliente.com.br/portal/canal_cliente/index.htm"
While IE.Busy Or IE.readyState <> 4: Wend
With .document
.getElementById("txtUsuario").Value = username
.getElementById("txtSenha").Value = password
.getElementById("btnEntrar").Click
End With
While IE.Busy Or IE.readyState <> 4: Wend
End With
Set IE = Nothing
End Sub
Error happens exactly on which line?
– César Rodriguez
OK! I learn fast.
– Itamar Conceição
The error appeared from . getElementById("txtUsuario"). Value = username, but the Augusto Vasques solution solved.
– Itamar Conceição