XML files into Excel

linesy

Board Regular
Joined
Sep 27, 2004
Messages
72
Hi all,

I have to download 43 files from an outside vendor and then consolidate those files into one workbook. Currently they download into c:\Users\Downloads and I open each one individually and it converts into an excel table.

Does anyone have any clues as to how can I easily get all of this data into one file and one sheet? I also only need rows that contain "IA-1" i column F.

If they were already excel workbooks I have a macro that would consolidate all of them but not sure how to do this with an XML file. Thanks for your help in advance.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi

This will generate Excel workbooks:

Code:
Sub XML_to_Excel()
' converts XML files into Excel tables


Dim wb As Workbook, xmlf$, fd$
fd = "C:\pub\"
ChDir fd
xmlf = Dir("*.xml")
Do While xmlf <> ""
    Set wb = Workbooks.OpenXML(FileName:=fd & "\" & xmlf, _
    LoadOption:=xlXmlLoadImportToList)
    MsgBox wb.FullName, 64
    xmlf = Dir
Loop
End Sub
 
Upvote 0
Thank you Worf...this works great! Is there a way of not having to confirm "ok" for every file that opens? Again, thanks for your expertise.

Obrigado .... visitei Rio em Março. Bela. O meu marido é de Minas :)
 
Upvote 0
Skip the message Bog line in his macro. (comment it out.)

Code:
'MsgBox wb.FullName, 64
 
Upvote 0
Like Spiller said, just remove that line of code.

Fico feliz que esteja funcionando!
 
Upvote 0

Forum statistics

Threads
1,223,270
Messages
6,171,102
Members
452,379
Latest member
IainTru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top