Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2007
    Posts
    54

    Unanswered: How can I get macro to ask for XML file location when refreshing data import?

    I have Excel 2003 and have written a macro to manipulate some data which I import from an XML file via a customised map.

    To refresh the data I have a line in my macro which says:

    ActiveWorkbook.XmlMaps("MyMap").Import URL:= "C:\Path\filename.xml"

    Now this works just fine except that I wish it would pop up an explorer dialogue box asking me exacly which xml file I want to import from which folder (starting from the C:\Path\ location).

    I have other macros that import csv or text files and that is what they do, but I can't find the same options with xml.

    Can someone tell me how to solve this aggravation, please?

    Thanks,
    Caspar

  2. #2
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    You could try this or similar but with .xml file spec and your annotation etc.

    Dim FileName as String
    FileName = Application.GetOpenFilename("Timesheets Consolidation (*.xls),*.xls", , "Select Consolidation Sheet to Use")

    Excel help for GetOpenFilename gives you all the info on how to use this method.

    Is that what you had in mind?

    MTB

Posting Permissions

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