LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel 2003 : Problem accessing childnodes in XMLDomElements

Hello,

Calling out for help... I've been searching and still clueless about this
one...

I'm trying to load an XML file, append data to it, then save it.

The following bit of a code is a test routine which illustrates my problem :

VBA Module :
_________________________
"Option Base 1

Sub xmlDomManipulation()

Dim xmlDoc As DOMDocument, root As IXMLDOMElement
Set xmlDoc = New DOMDocument

xmlDoc.async = False
xmlDoc.Load (ThisWorkbook.Path & "\Bookstore.xml")

Set root = xmlDoc.documentElement

ReDim xmlYear(root.childNodes.Length) As IXMLDOMNode

For i = 1 To root.childNodes.Length
Set xmlYear(i) = root.childNodes.Item(1)
ReDim xmlMonth(i, xmlYear(i).childNodes.Length) As IXMLDOMNode
For j = 1 To xmlYear(i).childNodes.Length
Set xmlMonth(i, j) = xmlYear(i).childNodes.Item(j)
Next j
Next i

End Sub"

XML File :
________________________

<?xml version="1.0"?
<data
<year y="2007" passed="1"
<month m="1"
<day d="01" ca="3497" pax="57"/
<day d="02" ca="5487" pax="73"/
<day d="03" ca="3256" pax="40"/
</month
</year

<year y="2008" passed="0"
<month m="1"
<day d="01" ca="3497" pax="57"/
<day d="02" ca="5487" pax="73"/
<day d="03" ca="3256" pax="40"/
</month
</year
</data

When I check the results of this routine via locals windows, I see that
xmlYear(i) is loaded correctly as an IXMLDOMNode, but xmlMonth(i, j) is set
as nothing....

Any clues to the how and the why of this would be welcome...

Cheers.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Excel data through Outlook 2003 echostorm Excel Programming 2 July 17th 06 05:42 AM
excel 2003 accessing hard drive and freezing mikeydeek Excel Discussion (Misc queries) 3 May 2nd 06 12:58 PM
Programmitically accessing WSS via Excel 2003 Data Ret Nock Excel Programming 6 February 10th 06 01:36 PM
Accessing Favorites in Excel 2003 Evan Excel Discussion (Misc queries) 1 January 25th 05 11:35 PM
Accessing Favorites in Excel 2003 Evan Setting up and Configuration of Excel 1 January 25th 05 10:27 PM


All times are GMT +1. The time now is 04:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"