Results 1 to 4 of 4

Thread: List Files In Folder & Subfolders Using DIR

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Dec 2015
    Posts
    3
    Rep Power
    0
    @snb - I use excel in office and want to learn vba as it reduces many of my repeated tasks. I want to take the list of files and folders in a network path with large number of files. If I do this manually, it will be a very difficult and repetitive work. I tried vbscript but it is also slow and not get all the details. I searched for this from web and got many code snippets, used them and compared and I found the above 2 codes very useful. The 2nd code is slightly faster and hence I tried to modify it similar to 1st code. I was unable to modify as it uses array and I am getting error. So I posted it here as I saw many users have asked similar questions. I found one similar thread to get the details of mp3 files but again I could not modify it for any file type. The answer given in other forum to use CMD shellobject give results but is also very slow.

    http://www.ozgrid.com/forum/showthre...97743&p=761097

    Regarding the error handlers, I run the codes on my local computer and see if there are any errors and how the results are displayed and change some code and see how the output is got. As a hobby, I like to search the web and test the codes for doing similar tasks and very much like working with lists.

    Thank You
    VijaySM

  2. #2
    Junior Member
    Join Date
    Dec 2015
    Posts
    3
    Rep Power
    0
    Hi Excel Experts

    Any response regarding the above question. Also, If the folder length exceeds 260 characters as some files downloaded from web have more than 260 characters, Dir throws error "file not found". My question to this error is whether a workaround can be made and code should not skip the folder or file.

    Regards
    VijaySM

Similar Threads

  1. Replies: 2
    Last Post: 03-09-2015, 11:26 PM
  2. Code to open up files in folder and sub-folder
    By Howardc in forum Excel Help
    Replies: 7
    Last Post: 08-26-2014, 07:01 AM
  3. Replies: 6
    Last Post: 04-15-2014, 03:58 PM
  4. Replies: 15
    Last Post: 08-23-2013, 12:03 PM
  5. List Of All Files In A Folder
    By Excel Fox in forum Excel Help
    Replies: 2
    Last Post: 10-27-2011, 09:10 AM

Tags for this Thread

Posting Permissions

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