+ Reply to Thread
Results 1 to 5 of 5

opening workbook found with Dir loop

  1. #1
    Forum Contributor
    Join Date
    09-19-2012
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    137

    opening workbook found with Dir loop

    I want to loop through workbooks found by the method below, opening each one so that I can search for and copy data in it.
    Please Login or Register  to view this content.
    I know it must be a problem with the path, but how do I change the path and still get the macro to loop through the "Dir" collection?
    All suggestions appreciated!

    Thanks,

    willardio

  2. #2
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: opening workbook found with Dir loop

    Hi Willardio,

    I think you should do it like this. Does it work?
    Please Login or Register  to view this content.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: opening workbook found with Dir loop

    willardio

    It isn't a wild claim - you've not told the code where to look for the file.

    StrFile will only contain the filename, so you need to add the path.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    09-19-2012
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: opening workbook found with Dir loop

    Thanks gergo, that helped. It showed me that I had to append the path like so:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-19-2012
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: opening workbook found with Dir loop

    And thank you too Norie, I'm going to work that in.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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