Home All Groups Group Topic Archive Search About

Microsoft code did not work?

Author
6 Mar 2006 9:19 PM
Andrew
Hi, guys,

I have the following source code copied from MSDN,
(http://support.microsoft.com/default.aspx?scid=kb;EN-US;q299566) where
Micrsoft XML 4.0 was referenced:

Dim obj As MSXML2.ServerXMLHTTP
Set obj = New MSXML2.ServerXMLHTTP
obj.open "GET", "http://localhost/testerr.htm"
obj.send

However, when I run it, I got an error message at the second line, saying:

Run tim error 430: Class does not support Automation or does not support
expected interface.

I really could not understand. Any ideas? Thanks.

Author
6 Mar 2006 9:29 PM
Ken Halter
Show quote Hide quote
"Andrew" <And***@discussions.microsoft.com> wrote in message
news:79CFA8A1-CFAC-4C4E-93AA-67BB588E5051@microsoft.com...
> Hi, guys,
>
> I have the following source code copied from MSDN,
> (http://support.microsoft.com/default.aspx?scid=kb;EN-US;q299566) where
> Micrsoft XML 4.0 was referenced:
>
> Dim obj As MSXML2.ServerXMLHTTP
> Set obj = New MSXML2.ServerXMLHTTP
> obj.open "GET", "http://localhost/testerr.htm"
> obj.send
>
> However, when I run it, I got an error message at the second line, saying:
>
> Run tim error 430: Class does not support Automation or does not support
> expected interface.
>
> I really could not understand. Any ideas? Thanks.

Gotta check the "fine" print.... which says....

'Use the version dependent PROGID of the ServerXMLHttp 'object if
referencing MSXML 4.0.
'( MSXML2.ServerXMLHTTP40 )

So.... make this change and it should run....

Dim obj As MSXML2.ServerXMLHTTP40
Set obj = New MSXML2.ServerXMLHTTP40


--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm