Consulting

Results 1 to 4 of 4

Thread: How can I display a list of folders and files in window?

  1. #1

    Question How can I display a list of folders and files in window?

    Hi, Sorry. Wasn't sure how to ask it. I wanted to know if this was possible with VBA.

    I posted a link to an example, but I only have one post, so the forum won't let me. But, the software I saw is writingoutliner. In the screenshots on the top menu, there is a picture if the software in Word. On the left there is a window of some sort that is displaying folders and the files under them.

    See that screenshot where they have the file names and the folders listed? Can that be done in VBA with Excel?

    I searched and saw the file scripting object, but it's the display that I'm after, not so much the simple list.

    Thanks.

  2. #2
    VBAX Mentor
    Joined
    Jul 2012
    Posts
    398
    Location
    [VBA]Sub SelectFile()
    Dim fPath As Variant
    ChDir "C:\Users\Andrea\Desktop" ' change the default directory if required
    fPath = Application.GetOpenFilename(Title:="Select A File") ' browse for a file
    Range("A5") = fPath ' put the file name in A5
    End Sub[/VBA]

  3. #3
    VBAX Regular HaHoBe's Avatar
    Joined
    Aug 2004
    Location
    Hamburg
    Posts
    89
    Location
    Hi, TheProgramme,

    to me it looks like you´re looking for the TreeView Control. I would use this as part of an UserForm which I would place vbModeless (mode available from Excel 2000 on up) and narrow the window for Excel itself.

    Ciao,
    Holger

  4. #4
    VBAX Mentor Teeroy's Avatar
    Joined
    Apr 2012
    Location
    Sydney, Australia
    Posts
    414
    Location
    This might go some way toward what you want: http://www.vbaexpress.com/kb/getarticle.php?kb_id=837
    _________________________________________________________________________
    "In theory there is no difference between theory and practice. In practice there is." - Chuck Reid

    Any day you learn something new is a day not wasted.

Posting Permissions

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