+ Reply to Thread
Results 1 to 3 of 3

How to open all excel files within a directory of folders.

  1. #1
    Registered User
    Join Date
    10-03-2013
    Location
    Jacksonville, USA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Question How to open all excel files within a directory of folders.

    Hey guys I am having difficulty with this VBA. I have gotten it to search for all excel files within a folder, but now I need it to be able to access excel files that are within folders from a parent directory. I have the following code:
    Please Login or Register  to view this content.
    I have it set up so that it pulls the directory name from a certain cell, which would be inputted by the operator, it works fine when I have all the spreadsheets within the same folder, but if there are folders within that folder with files I need it won't look for them.

    Another problem I have is that when copying the data from the spreadsheets it does open, a pop-up comes up when copying larger amounts of data, is there any way to stop that pop-up from appearing?

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: How to open all excel files within a directory of folders.

    maybe you can arrange this code
    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    10-03-2013
    Location
    Jacksonville, USA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: How to open all excel files within a directory of folders.

    Thank you very much patel45!
    I made a few edits, such as removing the Activeworkbook.close command because it was causing the program to close after the first paste. Also the msgbox after every file would be problematic with the number of files that we use.
    Below is what I ended up with and it worked seamlessly! Again, Thank you very much!

    I do have one question, I added a message box myself to tell the operator that they forgot to insert the address. Is there anyway I can conditionally stop the program if the mFolder=0? It would just be nice to not see an error message coming up after the message box?

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy matching files/folders (using unique ID) from one directory to another
    By TommyK25 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-10-2013, 06:38 AM
  2. Open ALL excel files on a folder, on different folders
    By ferrariako in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2013, 09:54 PM
  3. Can't open files from folders - Excel only
    By HFSGordo in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-28-2011, 05:10 PM
  4. open and close all excel files in directory
    By Alex in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2006, 07:35 PM
  5. Open Excel files/folders
    By animalfriend7 in forum Excel General
    Replies: 1
    Last Post: 06-23-2005, 07:05 PM

Tags for this Thread

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