+ Reply to Thread
Results 1 to 3 of 3

XML import with changing filename

  1. #1
    Forum Contributor
    Join Date
    03-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016-2019
    Posts
    144

    XML import with changing filename

    Dear members,

    I want a macro or vba code to import several xml files with different filenames in one workbook (different sheets "VH", "NW", "ZK"). I have a macro as example but need the code to import every day these xml files that have a new filename.
    The blue text is every day different but the red is every day the same. I copy these xml files every day in this folder and want to use the macro look into this folder to import these xml files in the workbook.

    Can someone help me with this issue.

    FvdF.


    ========================
    Sub ImportXML()
    '
    ' ImportXML Macro
    '
    '
    Sheets("VH").Select
    ActiveWorkbook.XmlImport URL:="D:\@FvdF\Desktop\XML\ST_VH_171004_0_2.xml", _
    ImportMap:=Nothing, Overwrite:=True, Destination:=Range("$A$1")
    Sheets("NW").Select
    ActiveWorkbook.XmlImport URL:="D:\@FvdF\Desktop\XML\ST_NW_171004_0_2.xml", _
    ImportMap:=Nothing, Overwrite:=True, Destination:=Range("$A$1")
    Sheets("ZK").Select
    ActiveWorkbook.XmlImport URL:="D:\@FvdF\Desktop\XML\ST_ZK_171004_0_2.xml", _
    ImportMap:=Nothing, Overwrite:=True, Destination:=Range("$A$1")
    End Sub
    =======================

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: XML import with changing filename

    Welcome to the forum! Click the menu icon # to insert code tags to paste your code between.

    Maybe something like:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016-2019
    Posts
    144

    Re: XML import with changing filename

    Dear Kenneth,

    Your code is not working yet and my knowledge about vba is from a beginner, so if you can explane why it is not working yet.
    The error is in the blue line.

    With regards,
    FvdF

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] filename contained in a cell to import data
    By AnnieMcken in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-12-2013, 02:27 AM
  2. [SOLVED] Trying to import filename based on cell contents
    By JesusOnEez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-28-2013, 10:11 AM
  3. [SOLVED] Import filename into seperate columns?
    By dark91zc in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-19-2013, 10:05 AM
  4. [SOLVED] Import Macro with Variable Filename
    By Yamaha14 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2012, 03:56 PM
  5. Compare filename, merge then import macro
    By jimbob2000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2009, 04:01 PM
  6. [SOLVED] Filename import
    By CiceroCF in forum Excel General
    Replies: 4
    Last Post: 01-04-2006, 10:00 AM
  7. [SOLVED] Create and import filename list into excel
    By Jim Semaj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-12-2005, 02:10 PM
  8. Text file import using filename reference
    By sbeaird in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-10-2005, 11:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1