Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Accessing Excel data through Outlook 2003 | Excel Programming | |||
excel 2003 accessing hard drive and freezing | Excel Discussion (Misc queries) | |||
Programmitically accessing WSS via Excel 2003 Data Ret | Excel Programming | |||
Accessing Favorites in Excel 2003 | Excel Discussion (Misc queries) | |||
Accessing Favorites in Excel 2003 | Setting up and Configuration of Excel |