convert xml to table use VBA

Joined
Feb 7, 2008
Messages
2
Reaction score
0
Hi Experts,
I am new with VBA. anyone please tell me how to convert XML to excel table.

for example see the following xml


<Rowsets>
<Rowset>
<Columns>
<Column MaxRange="100" MinRange="1" Name="STARTDATE" SQLDataType="1" SourceColumn="STARTDATE"></Column>
<Column MaxRange="100" MinRange="1" Name="ENDDATE" SQLDataType="1" SourceColumn="ENDDATE"></Column>
<Column MaxRange="100" MinRange="1" Name="SHIFT" SQLDataType="1" SourceColumn="SHIFT"></Column>
<Column MaxRange="100" MinRange="1" Name="LOCATION" SQLDataType="1" SourceColumn="LOCATION"></Column>
<Column MaxRange="100" MinRange="1" Name="MATERIAL" SQLDataType="1" SourceColumn="MATERIAL"></Column>
<Column MaxRange="100" MinRange="1" Name="TOMATERIAL" SQLDataType="1" SourceColumn="TOMATERIAL"></Column>
<Column MaxRange="100" MinRange="1" Name="PLANT" SQLDataType="1" SourceColumn="PLANT"></Column>
<Column MaxRange="100" MinRange="1" Name="QUANTITY" SQLDataType="1" SourceColumn="QUANTITY"></Column>
<Column MaxRange="100" MinRange="1" Name="SITE" SQLDataType="1" SourceColumn="SITE"></Column>
<Column MaxRange="100" MinRange="1" Name="TOLOCATION" SQLDataType="1" SourceColumn="TOLOCATION"></Column>
<Column MaxRange="100" MinRange="1" Name="TOPLANT" SQLDataType="1" SourceColumn="TOPLANT"></Column>
<Column MaxRange="100" MinRange="1" Name="TOSITE" SQLDataType="1" SourceColumn="TOSITE"></Column>
<Column MaxRange="100" MinRange="1" Name="UOM" SQLDataType="1" SourceColumn="UOM"></Column>
<Column MaxRange="100" MinRange="1" Name="PSEUDOCODE" SQLDataType="1" SourceColumn="PSEUDOCODE"></Column>
</Columns>
<Row>
<STARTDATE repeated="0">2008-01-13T19:00:00</STARTDATE>
<ENDDATE repeated="0">2008-01-14T06:59:59</ENDDATE>
<SHIFT repeated="0">1</SHIFT>
<LOCATION repeated="0">3005</LOCATION>
<MATERIAL repeated="0">70000720</MATERIAL>
<TOMATERIAL repeated="0">70000720</TOMATERIAL>
<PLANT repeated="0">1310</PLANT>
<SITE repeated="0">SITE1</SITE>
<TOLOCATION repeated="0">3005</TOLOCATION>
<TOPLANT repeated="0">1310</TOPLANT>
<TOSITE repeated="0">NA</TOSITE>
<UOM repeated="0">TO</UOM>
<PSEUDOCODE>GR-PO</PSEUDOCODE>
<QUANTITY>38470.46</QUANTITY>
</Row>
<Row>
<STARTDATE repeated="0">2008-01-14T07:00:00</STARTDATE>
<ENDDATE repeated="0">2008-01-14T18:59:59</ENDDATE>
<SHIFT repeated="0">2</SHIFT>
<LOCATION repeated="0">3005</LOCATION>
<MATERIAL repeated="0">70000720</MATERIAL>
<TOMATERIAL repeated="0">70000720</TOMATERIAL>
<PLANT repeated="0">1310</PLANT>
<SITE repeated="0">SITE1</SITE>
<TOLOCATION repeated="0">3005</TOLOCATION>
<TOPLANT repeated="0">1310</TOPLANT>
<TOSITE repeated="0">NA</TOSITE>
<UOM repeated="0">TO</UOM>
<PSEUDOCODE>GR-PO</PSEUDOCODE>
<QUANTITY>41707.761</QUANTITY>
</Row>
/Rowset>
<
/Rowsets>

i need to convert this table use VBA code.

columns are table headers and rows will display line by line.
anyone please suggest me how to convert XML to table.

Regards,
sapbbm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top