问题描述
以下代码段通常用于创建Internet Explorer实例并导航链接:
The following code snippet usually works to create an Internet Explorer instance and navigate a link:
Dim appIE As Object
Dim myLink As String: myLink = "www.something.com"
Set appIE = CreateObject("internetexplorer.application")
With appIE
.Navigate myLink
.Visible = True
End With
问题在于,取决于链接( myLink
),页面被导航但接口变为未知,对象 appIE
不包含变量。
The problem is that, depending on the link (myLink
), the page is navigated but then the interface becomes unknown and the object appIE
contains no variable.
例如,如果
myLink = "https://www.facebook.com"
...对象 appIE
显示Facebook登录页面并且可以被代码使用(即如果我添加了一个观察者,我可以看到该对象的所有属性。
但是,如果链接是:
... the object appIE
shows the Facebook login page and can be used by the code (i.e. if I add a watcher, I can see all the properties of the object.However, if the link is:
myLink = "https://mxjira.murex.com/secure/RapidBoard.jspa?rapidView=2030&view=detail&cb=7055"
...对象 appIE
提出了未知界面错误,并且,由观察者看到,此对象不包含任何变量。
... the object appIE
raises an "unknown interface" error and, seen by the watcher, this object contains no variable.
上面的链接受到保护(它是我公司的内部页面),但应该仍然提出问题的想法。
浏览器, appIE.Visible = True
,实际上是显示网页。为什么对象会丢失所有变量然后?我如何解决这个未知界面问题,如果我能看到webpag的内容,它来自哪里? e我刚刚创建的浏览器?
The link above is protected (it's an internal page of my company), but should still give an idea of the issue.The browser, with appIE.Visible = True
, is actually showing the webpage. Why is the object losing all its variables then? How can I fix this "unknown interface" issue, where is it coming from if I can see the content of the webpage in the browser I just created?
推荐答案
如果您阅读以下内容
如果你使用InternetExplorerMedium而不是InternetExplorer,它应该纠正你的问题。
If you use InternetExplorerMedium instead of InternetExplorer, it should correct your issue.
谢谢。
Nathan。
这篇关于internetexplorer.application对象引发“自动化错误 - 未知接口”。给定链接上的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!