Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reading File Names Into a Table

    Is there a way to read files names from a given directory and all it's sub directories into a table using VBA code.

    I have some code that reads a single directory and dumps the files to a table, but am having trouble getting it to push down into sub directories.


    Thanks for any help.
    Richard

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Here is a web page that has VBA code to read the subdirectories in a folder: VBA Dir function to get Subdirectories
    This page has a VB6 procedure that creates a list: Get all Files and Subdirectories ...
    Hopefully the two of those will give you some ideas in how to modify your existing code. One caution that comes to mind is that there may be some difference in directory designations between FAT32 and NTFS that the VB6 code may not be aware of - but I haven't explored that angle.
    Wendell

Posting Permissions

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