Bobadilha
15-04-2016 23:03:31
Srs,
Meu objetivo é entrar neste site (http://cvmweb.cvm.gov.br/SWB/Sistemas/S ... oConsult=c), consultar o nome de uma empresa, clicar em consultar e depois clicar na linha que contenha 'concedido'.
Consigo fazer a primeira parte, mas nao a segunda, de clicar no botão. Podem me ajudar? Já tentei com .click tambem e nada. Simplesmente não responde.
Public Sub ConectaWeb()
On Error Resume Next
Dim endereço As String
Dim mostra As Boolean
'entra no site
Dim i, n, x As Integer
endereço = "http://cvmweb.cvm.gov.br/SWB/Sistemas/S ... oConsult=c"
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate (endereço)
While ie.ReadyState <> 4
Wend
'seleciona o nome da empresa
ie.Visible = True
ie.document.all("txtCNPJNome").innerText = "EZ TEC"
While ie.ReadyState <> 4
Wend
ie.document.forms.Item("form1").submit
While ie.ReadyState <> 4
Wend
Application.Wait Now() + TimeValue("00:00:10")
'IDENTIFICA QUAL LINHA CONTEM 'CONCEDIDO'
sit = ie.document.all("dlCiasCdCVM__ctl1_Linkbutton9").innerText
While ie.ReadyState <> 4
Wend
j = 9
i = 2
a = Left(sit, 9)
While Left(sit, 9) <> "Concedido"
If j = 9 Then
j = 12
Else
j = 12
End If
i = i + 1
sit = ie.document.all("dlCiasCdCVM__ctl" & i & "_Linkbutton" & j & "").innerText
Wend
' CLICAR
ie.document.getElementById("dlCiasCdCVM$_ctl" & i & "_Linkbutton" & j & "").submit
While ie.ReadyState <> 4
Wend
End Sub
Meu objetivo é entrar neste site (http://cvmweb.cvm.gov.br/SWB/Sistemas/S ... oConsult=c), consultar o nome de uma empresa, clicar em consultar e depois clicar na linha que contenha 'concedido'.
Consigo fazer a primeira parte, mas nao a segunda, de clicar no botão. Podem me ajudar? Já tentei com .click tambem e nada. Simplesmente não responde.
Public Sub ConectaWeb()
On Error Resume Next
Dim endereço As String
Dim mostra As Boolean
'entra no site
Dim i, n, x As Integer
endereço = "http://cvmweb.cvm.gov.br/SWB/Sistemas/S ... oConsult=c"
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate (endereço)
While ie.ReadyState <> 4
Wend
'seleciona o nome da empresa
ie.Visible = True
ie.document.all("txtCNPJNome").innerText = "EZ TEC"
While ie.ReadyState <> 4
Wend
ie.document.forms.Item("form1").submit
While ie.ReadyState <> 4
Wend
Application.Wait Now() + TimeValue("00:00:10")
'IDENTIFICA QUAL LINHA CONTEM 'CONCEDIDO'
sit = ie.document.all("dlCiasCdCVM__ctl1_Linkbutton9").innerText
While ie.ReadyState <> 4
Wend
j = 9
i = 2
a = Left(sit, 9)
While Left(sit, 9) <> "Concedido"
If j = 9 Then
j = 12
Else
j = 12
End If
i = i + 1
sit = ie.document.all("dlCiasCdCVM__ctl" & i & "_Linkbutton" & j & "").innerText
Wend
' CLICAR
ie.document.getElementById("dlCiasCdCVM$_ctl" & i & "_Linkbutton" & j & "").submit
While ie.ReadyState <> 4
Wend
End Sub