Página 1 de 1

Validação de PIS no E-Social

Enviado: 22 Jun 2021 às 16:18
por alxndd
Boa tarde a todos.
Estou tentando fazer uma validação neste site, porem não consigo, pegar os dados de um relatorio e jogar os dados neste site, já consegui fazer em outro, mas o e-social não esta funcionando, tem algo de errado no meu codigo ?
Código: Selecionar todos
Dim HTMLDoc As HTMLDocument
Dim oBrowser As InternetExplorer


Sub Login()

Dim oHTML_Element As IHTMLElement
Dim sURL As String
On Error GoTo Err_Clear
   sURL = "http://consultacadastral.inss.gov.br/Esocial/pages/qualificacao/qualificar.xhtml"
Set oBrowser = New InternetExplorer
   oBrowser.Silent = True
   oBrowser.timeout = 60
   oBrowser.Navigate sURL
   oBrowser.Visible = True

Do
Loop Until oBrowser.ReadyState = READYSTATE_COMPLETE

For iCount = 1 To 30000000
 Next iCount

Set HTMLDoc = oBrowser.Document

  HTMLDoc.all.formQualificacaoCadastral: nome.Value = Range("B2")
  HTMLDoc.all.formQualificacaoCadastral: dataNascimento.Value = Range("C2")
  HTMLDoc.all.formQualificacaoCadastral: cpf.Value = Range("D2")
  HTMLDoc.all.formQualificacaoCadastral: nis.Value = Range("E2")



For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
    If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For

Next

On Error GoTo Err_Clear
   sURL = Range("") 'CLICAR PARA ADICONAR

Set oBrowser = New InternetExplorer
   oBrowser.Silent = True
   oBrowser.timeout = 60
   oBrowser.Navigate sURL
   oBrowser.Visible = True

Do
Loop Until oBrowser.ReadyState = READYSTATE_COMPLETE

    

For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
    If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For

Next
Err_Clear:

Resume Next
End Sub '