HTTPS证书错误excel VBA

时间:2017-09-04 10:17:39

标签: html excel vba excel-vba certificate

试图查看旧问题,但无法找到我想要的答案。

我试图制作一个能够自动清除打印机碳粉量的电子表格 - 但是,存在证书错误。

IE(以及Excel / VBA)不显示网站,而是显示cert.error HTML。

我该如何绕过这个?无法将站点添加到受信任的站点 - VBA可以以某种方式忽略该错误,还是可以创建VBA按Tab键,输入? 我尝试使用以下代码,但没有运气。

Enum readystate
    READYSTATE_UNINITIALIZED = 0
    READYSTATE_LOADING = 1
    READYSTATE_LOADED = 2
    READYSTATE_INTERACTIVE = 3
    READYSTATE_COMPLETE = 4
End Enum

Sub ImportPrinterData()
    Dim ie As InternetExplorer
    Dim html As HTMLDocument
    Set ie = New InternetExplorer
    ie.Visible = False
    ie.navigate "https://to-port3-hp1c/"
    Do While ie.readystate <> READYSTATE_COMPLETE
        Application.StatusBar = "Venter på printer data ..."
        DoEvents
    Loop
    Set html = ie.document
    Application.SendKeys "{tab 7}", True
    Application.SendKeys "{return}", True
    MsgBox html.DocumentElement.innerHTML
    Set ie = Nothing
    Application.StatusBar = ""
End Sub

0 个答案:

没有答案