Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ConnectObject method & IE

96 views
Skip to first unread message

Brian Kearney

unread,
Sep 27, 2001, 9:00:24 AM9/27/01
to
I have been unable to get the following code to run in a
WSF (Windows Script File):

set MyIE = CreateObject("InternetExplorer.Application")
WScript.ConnectObject MyIE, "PHGIE_"

Although the Windows Script 2.0 documentation has
identical syntax, this throws the folloe=wing error
message:

"Could not connect object
Code: 80020009"

All help is welcome!

Joe Fawcett

unread,
Sep 27, 2001, 10:11:05 AM9/27/01
to
I don't think you can do this due to IE not adding its moniker to the ROT.
You can use :
Set myIE = WScript.CreateObject("InternetExplorer.Application", "PHGIE_")
which should be OK.
Joe
"Brian Kearney" <bkea...@empirix.com> wrote in message
news:3f0001c14754$5f3c5920$9ae62ecf@tkmsftngxa02...

Michael Harris (MVP)

unread,
Sep 27, 2001, 10:47:12 AM9/27/01
to
Use this...

set MyIE = WScript.CreateObject("InternetExplorer.Application","PHGIE_")

As for ConnectObject, there was a disclaimer in the Remarks section of the old documentation that
seems to have been removed in the new docs. It said something to the effect that ConnectObject only
works with an object that can enumerate its outgoing interface on request (and IE is not one of
those)...

The issue Joe mentioned (no IE entry in the ROT - Running Object Table) has to do with using

set myIE = GetObject(,"InternetExplorer.Application")

syntax to get a reference to an existing instance (which does not work with IE)...

--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--

"Brian Kearney" <bkea...@empirix.com> wrote in message
news:3f0001c14754$5f3c5920$9ae62ecf@tkmsftngxa02...

Joe Fawcett

unread,
Sep 27, 2001, 11:17:16 AM9/27/01
to
I stand corrected, or sit in this case...
"Michael Harris (MVP)" <mik...@mvps.org> wrote in message
news:eHgHSN2RBHA.1676@tkmsftngp04...
0 new messages