+ Reply to Thread
Results 1 to 7 of 7

Not finding other files in current folder

  1. #1
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Not finding other files in current folder

    User has several files in same Folder. This first part of the Code in the ADMIN file in the Folder should look at each one in turn. Those containing the string "File Complete" anywhere should be listed in Cols A and B, and those without the string should be listed in Cols D and E.

    My understanding was that if all the files are in the same Directory, then the full File Path is not needed to call the other files, because "strPath = ThisWorkbook.Path" would be adequate.

    Please Login or Register  to view this content.
    All solutions, suggestions and alternatives welcome as ever

    Ochimus
    Last edited by Ochimus; 09-20-2019 at 11:59 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Not finding other files in current folder

    Hello Ochimus,

    The only potential issue I can see is if you have not yet saved the workbook with the macro code. Until a workbook has been saved, the Path property will be an empty string. An empty string would then immediately exit the Do loop.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Not finding other files in current folder

    Leith,

    Thanks for prompt response. Sadly life is not so simple. Saved the file, closed everything, opened it again, and Macro crashed at File Path not found.
    At the risk of sounding inane, could it be because the folder is in the Cloud and not on the machine itself?

    Ochimus

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Not finding other files in current folder

    Hello Ochimus,

    Thanks was my next question. If it is in the cloud or on a network prefix your path with "//?/server name/" & ThisWorkbook.Path

  5. #5
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Not finding other files in current folder

    Leith,

    Thanks for that. My "server name" appears to be "https://d.docs.live.net/", but will it be the same for the End User?
    And, if not, how do I write the Code so they don't have to open the Macro and type anything in?

    Ochimus

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Not finding other files in current folder

    Hello Ochimus,

    If your workbook is located on the web at "https://d.docs.live.net/", which is the server address, then it will be the same for everyone.

    Is the macro in this workbook?

  7. #7
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Not finding other files in current folder

    Leith,

    Yes. I created four "dummy" workbooks and an Admin one, and put them in the same folder to test everything.

    The Macro is in a Module in the Admin workbook, the idea being that as it was open it could access the other files automatically.

    Ochimus

+ 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 files and delete current folder and subfolders
    By maym in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2018, 10:34 PM
  2. VBA to Delete Files within current Folder
    By midnightorion in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-15-2017, 10:02 AM
  3. Loop Through all files in folder only finding first file
    By Optional_karl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-02-2016, 07:28 AM
  4. Finding the author of files in a folder using VBA?
    By Eat Well in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-09-2014, 05:36 AM
  5. Finding the author of files in a folder using VBA?
    By Eat Well in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2014, 10:42 PM
  6. Disable save prompt for all files in current folder?
    By GregTheSquarePeg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-09-2014, 09:37 AM
  7. Finding the Path to the Program Files Folder
    By JGS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2005, 05:19 AM

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