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

OLE objects

98 views
Skip to first unread message

Laurel

unread,
Mar 31, 2004, 12:23:27 PM3/31/04
to
I'm trying to convert some existing code to work in a new situation., and
there are statements that are unfamiliar to me. Statement #1 returns 0.
Statement #2 produces a "null object referenced." (Not necessarily exact
language.) Can someone tell me what I need to do in my environment to make
these statements work? I'm pretty much flying blind here... muddling
through all kinds of new spaces.

OleObject lo_xmldoc

OleObject lo_node

OLEObject lo_nodelist

lo_xmldoc = CREATE OLEObject

lo_nodelist = CREATE OLEObject

ll_Return = lo_xmldoc.ConnectToNewObject( "MSXML.DOMDocument" ) //STATEMENT
#1

as_xml = Mid(as_xml,9,Len(as_xml))

as_xml = Mid(as_xml,1, Len(as_xml) - 9)

ls_xml = as_xml

Do While Len(ls_xml) > 0


ls_xml1 = Mid(ls_xml,1,Pos(Lower(ls_xml),"</stage>")+7)

lo_xmldoc.loadxml(ls_xml1)


lo_nodelist = lo_xmldoc.SelectSingleNode("Stage").childNodes //STATMENT #2


Daniel

unread,
Apr 1, 2004, 3:36:20 PM4/1/04
to
Hi Laurel,

I don't have much experience on OLE either, but I've used it
to connect to a excel sheet. When I did that, I had an
statement just like your statement #1, except that instead
of "MSXML.DOMDocument", I used "Excel.Application".
This statement connected me to MS Excel, and then I could
change the value/properties of an excel sheet.
Seems like your trying to open some XML Document. I think
what you need is the XML program to handle this XML. After
that, your statements should all work.

Laurel

unread,
Apr 2, 2004, 2:43:56 PM4/2/04
to
Well, someone told me that I needed to install MSXML. I'm on Windows XP Pro
also. Dell installed the OS. Do you have any idea why I didn't have it and
you did? Where are those decisions made?

"JHP" <goawa...@GFY.com> wrote in message news:406c837b$1@forums-1-dub...
> I'm on WindowsXP Pro...
>
> The following is some sample code for the attached file - and it works
ok -
> If you need any help just let me know?
>
> OLEObject ole_DOM, ole_node
>
> ole_DOM = CREATE OLEObject
> ole_DOM.ConnectToNewObject("MSXML2.DOMDocument")
> ole_DOM.Async = False
> ole_DOM.ValidateOnParse = False
> ole_DOM.ResolveExternals = False
> ole_DOM.PreserveWhiteSpace = False
> ole_DOM.SetProperty("ServerHTTPRequest", True)
>
> If ole_DOM.Load("C:\Sample.xml") Then
> ole_node = ole_DOM.GetElementsByTagName("description")
>
> If ole_node.Length > 0 Then MessageBox("Node",
> String(ole_node.Item(1).NodeTypedValue))
>
> End If
> DESTROY ole_DOM
>
> "Laurel" <Fake...@Hotmail.com> wrote in message
> news:406afe8f$1@forums-1-dub...

JHP

unread,
Apr 5, 2004, 10:42:04 AM4/5/04
to
I don't know why you were told to install XML - as it is built into Windows
XP:

http://www.xlon6.com/support/kb.php/2002

You may want to try "MSXML2.DOMDocument" instead of "MSXML.DOMDocument"...

Good luck!

"Laurel" <Fake...@Hotmail.com> wrote in message

news:406dc27c$1@forums-1-dub...

0 new messages