ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro code for XML Fill (https://www.excelbanter.com/excel-programming/404089-macro-code-xml-fill.html)

born2achieve

macro code for XML Fill
 
Dear friend,
i need to read xml and i need to fill in my excel workbook

for example
i need to loop through the xml and fill values in my EXcel Workbook the
example
for loop xmldatas
ColumnA :id
columnB :name
columnC :mark
columnD:designation
next

so like this i need to fill my excel values.can u please help me to do this
please friend

this is my xml:

<?xml version="1.0"?
<data
<student
<id1</id
<nameRaymond</name
<age11</age
<mark0</mark
<designationengneer</designation
</student


<student<id2</id
<nameMoon</name
<age11</age
<mark100</mark
<designationblody</designation
</student


<student<id3</id
<nameBilly</name
<age11</age
<mark100</mark
<designationpassd</designation
</student


<student<id4</id
<namePan</name
<age12</age
<mark80</mark
<designationvhonr</designation
</student


<student<id5</id
<nameQueenie</name
<age10</age
<mark90</mark
<designationsogjg</designation
</student


</data

joel

macro code for XML Fill
 
Look at the microsoft webpage. This method works very well. make sure you
add the References to the VBA window as instructions specify.

If this doesn't help, I can write code to perform the task.

"born2achieve" wrote:

Dear friend,
i need to read xml and i need to fill in my excel workbook

for example
i need to loop through the xml and fill values in my EXcel Workbook the
example
for loop xmldatas
ColumnA :id
columnB :name
columnC :mark
columnD:designation
next

so like this i need to fill my excel values.can u please help me to do this
please friend

this is my xml:

<?xml version="1.0"?
<data
<student
<id1</id
<nameRaymond</name
<age11</age
<mark0</mark
<designationengneer</designation
</student


<student<id2</id
<nameMoon</name
<age11</age
<mark100</mark
<designationblody</designation
</student


<student<id3</id
<nameBilly</name
<age11</age
<mark100</mark
<designationpassd</designation
</student


<student<id4</id
<namePan</name
<age12</age
<mark80</mark
<designationvhonr</designation
</student


<student<id5</id
<nameQueenie</name
<age10</age
<mark90</mark
<designationsogjg</designation
</student


</data


born2achieve

macro code for XML Fill
 
Dear joel,
pls i am need of your code.please help me to do this

joel

macro code for XML Fill
 
I went back to your posting on Jan 7th. what was the results of my changes?
Did you add the references to the VBA code? did it give you any results?
Did you look at this web page (listing 9)
http://msdn2.microsoft.com/en-us/lib...fice.11).aspx?

let me know what you are havving problems with and I will help. The actual
webbpage of the XML text code (use notepad to open XML page and post results).

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 joel,
pls i am need of your code.please help me to do this


born2achieve

macro code for XML Fill
 


Dear Joel, thanks for your help,thanks a lot




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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com