【问题标题】:Excel VBA InternetExplorer.document - Automation/unspecified errorExcel VBA InternetExplorer.document - 自动化/未指定错误
【发布时间】:2022-07-22 16:41:41
【问题描述】:

我是 excel VBA 美妙世界的新手。我正在尝试从我们的公司页面上抓取一些数据。正如您在图片中看到的,我收到了自动化/未指定错误。有任何想法吗?我打开哪个页面都没有关系,一旦我开始使用文档就会导致错误。

Sub PMM()
    
    'declaration
    Dim ie As InternetExplorer
    Dim ht As HTMLDocument
    Dim UserName As String, Password As String, LoginData As Worksheet
    Set LoginData = ThisWorkbook.Worksheets("Sheet1")
    UserName = LoginData.Cells(1, "B").Value
    Password = LoginData.Cells(2, "B").Value
    
    'Inicialization
    Set ie = New InternetExplorer
    ie.navigate ("http://czpskmii0021.ls.ege.ds:50000/XMII/CM/SC_MAINTENANCE/Report/WorkOrderList.irpt")
    document = ie.document.getElementById("logonuidfield")
    'Set ht = ie.document
    'ht.getElementById ("logonuidfield")


End Sub   

【问题讨论】:

    标签: excel vba internet-explorer


    【解决方案1】:

    通过更改 Internet 选项修复它 -> 安全 -> 启用保护模式

    Protected mode

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-23
      • 1970-01-01
      • 2014-07-18
      • 1970-01-01
      • 1970-01-01
      • 2019-05-11
      • 2013-10-23
      相关资源
      最近更新 更多