+ Reply to Thread
Results 1 to 6 of 6

Show Folder Contents in Drop Down List

  1. #1
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Show Folder Contents in Drop Down List

    Hi all,

    I have an input box that the user uses to type in the name of the file that he wants to open. It works but the user just informed me that he would rather have something like a drop down menu that displays all the files in the folder so that he can choose a file instead of trying to remember the name and then typing it in. I'm sure this is possible but I am having troubles.

    Regards:
    Michael
    Last edited by Mordred; 05-11-2011 at 02:24 PM.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Show Folder Contents in Drop Down List

    Mordred,

    I would recommend using the GetOpenFileName and setting a default folder to show:
    Please Login or Register  to view this content.

    Notes:
    • Change the strDefaultFolder to the folder you want displayed
    • If you only want to show Excel files instead of all files, remove the apostrophe in front of filefilter

    Hope that helps,
    ~tigeravatar

  3. #3
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Show Folder Contents in Drop Down List

    Here is another method:

    Please Login or Register  to view this content.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  4. #4
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Show Folder Contents in Drop Down List

    I have meetings to go to for the next couple of hours so I won't mark this as solved yet but I'm sure that both will work. Thanks folks!

  5. #5
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Show Folder Contents in Drop Down List

    Yep, works like a charm. tigeravatar's worked really well but davegugg's was a little problematic for me. I couldn't get it to recognize the combo box I was using. At any rate, I appreciate the help and this is solved.

    Oh and one more thing, I love that signature of yours davegugg! Does that mean you are winning?

  6. #6
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Show Folder Contents in Drop Down List

    Thank, I'd like to say it is original, but I stole it from a site full of one-liners.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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