Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I added activesheet in front of combox1. Also added library references as
stated below On the Project menu, click References. Select the type libraries for Microsoft ActiveX Data Object 2.5 (or later) and Microsoft XML 3.0. Sub test() Dim articleDoc As New DOMDocument Dim sections As IXMLDOMNodeList Dim sectionNode As IXMLDOMNode Dim s As String articleDoc.async = False articleDoc.Load ("C:\temp\test\test.xml") 'Me.Caption = articleDoc.selectSingleNode("//student/name").Text Set sections = articleDoc.selectNodes("//student") ActiveSheet.ComboBox1.Clear For Each sectionNode In sections ActiveSheet.ComboBox1.AddItem (sectionNode.selectSingleNode("name").Text) Next ActiveSheet.ComboBox1.ListIndex = 0 End Sub "born2achieve" wrote: Dear friend, excellent.your code works fine and i want to share the code that i have found also. dim articleDoc As New DOMDocument Dim sections As IXMLDOMNodeList Dim sectionNode As IXMLDOMNode Dim s As String articleDoc.async = False articleDoc.Load ("C:\default.xml") 'Me.Caption = articleDoc.selectSingleNode("//student/name").Text Set sections = articleDoc.selectNodes("//student") ComboBox1.Clear For Each sectionNode In sections ComboBox1.AddItem (sectionNode.selectSingleNode("name").Text) Next ComboBox1.ListIndex = 0 so i got two solutions.very happy friend i have one more help . i need to import this xml to my excel workbook using macros can u please show me some sample code please |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
Adding to excel user form combobox | Excel Programming | |||
Fill a combobox on a form from a txt file | Excel Programming | |||
Getting the 2nd largest or smallest valuesin a range | Excel Discussion (Misc queries) | |||
Excel 2000 VBA Form Combobox value | Excel Programming |