Visual Basic para Aplicaciones - Certificado Digital

Life is soft - evento anual de software empresarial
 
Vista:

Certificado Digital

Publicado por Jose (14 intervenciones) el 07/03/2020 11:05:58
Hola. Estoy tratando de conectarme (y lo consigo) a una URL pero me exige un certificado digital. La URL me solicita que active un certificado digital y lo hago de manera manual ¿hay algún codigo vba que me permita activar automáticamente mi certificado digital? Os adjunto el código que estoy utilizando


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Sub ComprobarNIF_AEAT()
 
 
'This will load a webpage in IE
    Dim i As Long
    Dim URL As String
    Dim IE As Object
    Dim objElement As Object
    Dim objCollection As Object
    Dim HWNDSrc As Long
 
 
    'Create InternetExplorer Object
    Set IE = CreateObject("InternetExplorer.Application")
 
    'Set IE.Visible = True to make IE visible, or False for IE to run in the background
    IE.Visible = True
 
    'Define URL
    URL = "https://www1.agenciatributaria.gob.es/wlpl/BUGC-JDIT/Cnec"
 
    'Navigate to URL
    IE.Navigate URL
 
    ' Statusbar let's user know website is loading
    Application.StatusBar = URL & " is loading. Please wait..."
 
    ' Wait while IE loading...
    'IE ReadyState = 4 signifies the webpage has loaded (the first loop is set to avoid inadvertantly skipping over the second loop)
    Do While IE.ReadyState = 4: DoEvents: Loop
    Do Until IE.ReadyState = 4: DoEvents: Loop
 
    'Webpage Loaded
    Application.StatusBar = URL & " Loaded"
 
 
    IE.document.getelementbyid("areaDatos").Value = Range("D202")
 
 
 
    'Unload IE
 
    Set IE = Nothing
    Set objElement = Nothing
    Set objCollection = Nothing
 
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder