How to import multiple xml file into excel

Anonymous
2012-09-13T00:07:12+00:00

I have a lot of xml files which need to be imported into single excel file. I can able to import one by one but cannot select all at a time to import.

Is it possible to do through batch process or any other process?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

66 additional answers

Sort by: Oldest
  1. Anonymous
    2015-03-24T20:49:19+00:00

    TasosK,

    I agree that the link you sent for exporting is the right approach.  But when I used the script you wrote to import the .xml files I seemed to have lost all of the mapping.  Is there a way to modify the script to ensure that the mapping for each .xml file remains?  I need each imported file to be exported with its own specific mapping and as its own individual .xml file.

    That being said all of the files do follow the same general mapping schema...so that may be of help with the problem.

    Jonathan

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2015-03-24T20:55:09+00:00

    Also...

    When I tired to import just one of the .xml files and then export it back as a .xml as a test, I got this dialogue box (see picture).

    Does this mean even if I can get the mapping information to stick during the import I may not be able to export this mapping type?

    Jonathan

    Was this answer helpful?

    0 comments No comments
  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Anonymous
    2015-03-25T14:42:37+00:00

    Hi,

    try to load only one xml file in a new sheet

    Sub Load_XML_in_a_new_Sht()

    'Mar 13, 2015

    Dim wb As Workbook, wb1 As Workbook

    Set wb = ThisWorkbook

    Dim sPath

    sPath = "c:\folder1\folder2" '<< change path, change

    Dim sFile

    sFile = "sample xml.xml" '<< xml file name, change

    Application.ScreenUpdating = False

    Set wb1 = Workbooks.OpenXML(Filename:=sPath & sFile, LoadOption:=xlXmlLoadImportToList)

    wb.Sheets.Add

    wb1.Sheets(1).UsedRange.Copy wb.ActiveSheet.Range("A1")

    wb1.Close False

    wb.Save

    Application.ScreenUpdating = True

    End Sub

    If the XML (XML Spreadsheet 2003) data defines multiple worksheets, can a specific worksheet be imported other than the first one. (The sourcer actually sends the file with an XLS extension :( ! )

    (Goal is to import from multiple files to single file, with appending enabled for future files. Desired worksheet is named "Posted Transactions" and also "always" appears as second worksheet .

    Was this answer helpful?

    0 comments No comments