How to Write Macros for importing XML to excel 2003 ?

Posted by Nav234 under XML on 11/12/2010 | Points: 10 | Views : 5514 | Status : [Member] | Replies : 1
Hi all ,

I have written a sample xml file and tried to write macros and imported data into excel .
my xml file looks like this
<Root>
<Name>Roshan</Name>
<Designation>Fresher</Designation>
</Root>

then in the macro (VB editor in excel 2003) i have called a sub function like ,

Sub ReadXML()

Dim xml_doc As New DOMDocument
Dim nde_test As IXMLDOMElement
xml_doc.Load "D:\MyXML.xml"
For Each nde_test In xml_doc.selectNodes("//Root")
Cells(1, 0) = nde_test.selectSingleNode("Name").Text
Cells(1, 1) = nde_test.selectSingleNode("Designation").Text
Next
End Sub

OUTPUT COMES GOOD IN EXCEL 2003 LIKE ,
A B
1 Roshan Fresher

But my REQUIREMENT is i need to import large data example
A B
1 Roshan Fresher
2 Nithya Junior Developer
3 Shravan Senior Developer
4 Jithan Technical architect

For this OUTPUT ,how should i write XML and How should i BIND it in my MACRO,
Kindly help on this issue soon.....

Thanks in advance

S.Naveen...


Responses

Posted by: Lalji_mer on: 11/12/2010 [Member] Bronze | Points: 25

Up
0
Down
Hi,

if you want to do using vb.net then you will get some information from this link

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/XML/Q_22908047.html

LP MER

Nav234, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response