Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Chapel Hill, North Carolina, USA
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA to retrieve file names in a directory (2003)

    Is there a way to use VBA to retrieve the names of the files in a selected directory? I need to import all the files in a directory. The import process works well, but I need to enter the names one at a time or paste the names into a table - can Access read the names directly from the directory/folder?

    Thanks!

    Larry

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA to retrieve file names in a directory (2003)

    You can use the function Dir to retrieve a file.
    See Hans' code in <post#=659670>post 659670</post#> for a sample.
    Francois

Posting Permissions

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