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
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.
For example, if
myLink = "https://www.facebook.com"
... 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"
... the object appIE
raises an "unknown interface" error and, seen by the watcher, this object contains no variable.
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?
If you read the following
Excel VBA Controlling IE local intranet
If you use InternetExplorerMedium instead of InternetExplorer, it should correct your issue.
Thanks.
Nathan.