【发布时间】:2014-10-13 19:16:13
【问题描述】:
我正在通过 excel VBA 实现 Internet Explorer 9 的自动化,当我到达下面的最后一行时,它会引发错误:
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate "https://example.com/Main.asp"
'delay till readystate is complete
Set doc = ie.document
Set doc1 = doc.frames(2).document 'here comes the error
有人可以帮忙吗?
【问题讨论】:
-
去掉多余的
Set ie = New InternetExplorer,在.navigate后面加上Do Until IE.ReadyState = 4: DoEvents: Loop。尝试使用 F12 在网页内容中手动查找必要的框架。 -
网页上确实有框架。我用 F12 进行了检查
标签: vba internet-explorer excel frames comexception