Link to home
Start Free TrialLog in
Avatar of smilitaru
smilitaruFlag for Romania

asked on

GetObject with InternetExplorer

I want to take a reference from an open InternetExplorer object, but GetObject return the error:
"ActiveX component can't create object"

I used the code:

    Dim ie As SHDocVw.InternetExplorer

    Set ie = GetObject(, "InternetExplorer.Application")

Creating InternetExplorer has no problem with:
    Dim ie As SHDocVw.InternetExplorer

    Set ie = CreateObject("InternetExplorer.Application")
Avatar of pellep
pellep
Flag of Sweden image

try this
set ie = GetObject("", "InternetExplorer.Application")

You need to supply a zero.length string ("")

ASKER CERTIFIED SOLUTION
Avatar of BobbyOwens
BobbyOwens

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes you need to supply a zero length string for it to work.  btw, why are you using getobject in this case anyways?
Avatar of smilitaru

ASKER

Comment accepted as answer
Thanks BobbyOwens
It is just what I need.
Do you know something similar for Netscape?
Avatar of BobbyOwens
BobbyOwens

You might be able to use the same using the "WebBrowser" object instead of "InternetExplorer" object when processing the Shellwindows collection. I've never tried this though