+ Reply to Thread
Results 1 to 12 of 12

ListBox in a Userform to load data from external XML file

  1. #1
    Registered User
    Join Date
    11-20-2015
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    ListBox in a Userform to load data from external XML file

    I searched the forum and couldn't find a solution for my question
    I am very new to this forum and not an expert in VBA and Macros (trying to learn)

    I am trying to create a userform with a list box with name (populated from an external XML file) and fill a text box with rest of the details

    For Example:

    Name: Jerry Smith
    Address: 145 Miller Road, PA 17015
    Phone: (123) 456 4567


    Name: Bob Jones
    Address: 653 Maple Court, Hamilton, OH 45023
    Phone: (123) 567 5677

    Thanks in advance

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: ListBox in a Userform to load data from external XML file

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    To add a file to a new post

    To add a file to an existing post.

  3. #3
    Registered User
    Join Date
    11-20-2015
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    Question Re: ListBox in a Userform to load data from external XML file

    Here is an Example of the userform
    In this case the name and details are populated from the sheet itself, but I am looking for these to read from an external XML file and the complete result should be displayed in just one single TextBox as shown in the picture.

    listbox from xml.png
    Attached Files Attached Files

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: ListBox in a Userform to load data from external XML file

    Show a sample xml file and where to get it.



  5. #5
    Registered User
    Join Date
    11-20-2015
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: ListBox in a Userform to load data from external XML file

    I searched the web and found this link for XML
    https://msdn.microsoft.com/en-us/library/aa468547.aspx

    Below is the Sample XML file

    Please Login or Register  to view this content.
    Hope this helps
    Thanks!

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: ListBox in a Userform to load data from external XML file

    I have no idea what could be the benefit to present the data that are being shown in separate textboxes be represented a second time.



    But anyhow: you will have to adapt the fullname of the XLM-file.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-20-2015
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: ListBox in a Userform to load data from external XML file

    snb,
    Thanks for sharing the file.
    I appreciate your time and effort.
    I was searching the web and found a very valuable example of reading XML file and loading into a word document.
    But I am trying to get this filled within the userform.


    I hope someone can help me get this implemented inside the userform
    Last edited by powerplug; 11-23-2015 at 08:55 PM.

  8. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: ListBox in a Userform to load data from external XML file

    Why do you post a Word question in an Excel forum ?

  9. #9
    Registered User
    Join Date
    11-20-2015
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: ListBox in a Userform to load data from external XML file

    I found this example in the Word but I wanted to get this working in the Excel. I just posted that as an example.
    I tried to modify that example code to work with Excel Userform and didn't work. So I am asking help from Excel experts here.

  10. #10
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: ListBox in a Userform to load data from external XML file

    So why don't you use my Excel solution ??

  11. #11
    Registered User
    Join Date
    11-20-2015
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: ListBox in a Userform to load data from external XML file

    snb,
    I am trying to manage with your macro now, but any update or better solution without creating an Excel sheet is always welcome

  12. #12
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: ListBox in a Userform to load data from external XML file

    Every Excel workbook has at least 1 worksheet, so what is the problem ?

+ 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. Load userform combobox and listbox from worksheet
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2014, 08:46 AM
  2. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 PM
  3. Beginner, trying to load external data between two dates specified via userform
    By RobertSteggles in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-09-2012, 05:12 PM
  4. [SOLVED] Is it possible to save data entered in a userform to an external (unopened) excel file?
    By mrapes in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 06-11-2012, 06:46 PM
  5. load data into combobox from external workbook
    By MartyZ in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-08-2012, 05:20 AM
  6. Load List from External Excel file
    By Enrique Becerra in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-17-2005, 10:20 AM
  7. Load data into a listbox
    By Jennifer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2005, 08:05 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