'OPTION FIEL
While .Busy = True Or .readyState < 4: DoEvents: Wend
Do Until objIE.readyState = 4: DoEvents: Loop
objIE.document.getElementById("buttonFiel").Click
While .Busy = True Or .readyState < 4: DoEvents: Wend
Do Until objIE.readyState = 4: DoEvents: Loop
'ACCESS WITH CER AND KER
Application.Wait (Now + TimeValue("0:00:03"))
Set AttachCER = objIE.document.getElementById("fileCertificate")
Set AttachCERTXT = objIE.document.getElementById("txtCertificate")
Set AttachKEY = objIE.document.getElementById("filePrivateKey")
Set AttachKEYTXT = objIE.document.getElementById("txtPrivateKey")
Hola, necesito ingresar a una página,. Para ello necesito adjuntar dos documentos de autentificación, sin embargo, no he logrado hacerlo. Ayudaaa
La página es https://wwwmat.sat.gob.mx/app/seg/faces/pages/lanzador.jsf?url=/operacion/20777/consulta-tu-opinion-de-cumplimiento-de-obligaciones-fiscales&tipoLogeo=c&target=principal&hostServer=https://wwwmat.sat.gob.mx
Allí se encuentra el código fuente.
El error se encuentra al adjuntar los archivos, pues la página no los reconoce como adjuntos...
Direc = "https://wwwmat.sat.gob.mx/app/seg/faces/pages/lanzador.jsf?url=/operacion/20777/consulta-tu-opinion-de-cumplimiento-de-obligaciones-fiscales&tipoLogeo=c&target=principal&hostServer=https://wwwmat.sat.gob.mx"
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
objIE.navigate Direc
With objIE
'OPTION FIEL
While .Busy = True Or .readyState < 4: DoEvents: Wend
Do Until objIE.readyState = 4: DoEvents: Loop
objIE.document.getElementById("buttonFiel").Click
While .Busy = True Or .readyState < 4: DoEvents: Wend
Do Until objIE.readyState = 4: DoEvents: Loop
'ACCESS WITH CER AND KER
Application.Wait (Now + TimeValue("0:00:03"))
Set AttachCER = objIE.document.getElementById("fileCertificate")
Set AttachCERTXT = objIE.document.getElementById("txtCertificate")
Set AttachKEY = objIE.document.getElementById("filePrivateKey")
Set AttachKEYTXT = objIE.document.getElementById("txtPrivateKey")
AttachCERTXT.Value = "CONFIDENCIAL.cer"
AttachKEYTXT.Value = "Claveprivada_FIEL_CONFIDENCIAL_20170529_114039.key"
AttachCER.innerText = "C:\Users\...._20170529114039\CONFIDENCIALpa.cer"
AttachKEY.innerText = "C:\Users\...._20170529114039\CONFIDENCIAL529_114039.key"
AttachCER.FireEvent ("onclick")
AttachKEY.FireEvent ("onclick")
AttachCERTXT.FireEvent ("onclick")
AttachKEYTXT.FireEvent ("onclick")
objIE.document.getElementById("rfc").Value = "CONFIDENCIAL"
objIE.document.getElementById("privateKeyPassword").Value = "CONFIDENCIAL"
objIE.document.getElementById("submit").Click