+ Reply to Thread
Results 1 to 6 of 6

Last Modified date of a file based on partial name

  1. #1
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    2,094

    Last Modified date of a file based on partial name

    I have the following code that is supposed to search for a file and to check the last modified date. if is less than 2 days ago, then it needs to close this workbook and open that one. The colored line returns an error, file not found. Any ideas why?
    Please Login or Register  to view this content.
    If I am adding the full name of the file, it works properly.
    Click the * to say thanks.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    12,948

    Re: Last Modified date of a file based on partial name

    What's the error?

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    2,094

    Re: Last Modified date of a file based on partial name

    Run time error 53, File not found

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    5,839

    Arrow


    Just a bad path, check it out !

  5. #5
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    2,094

    Re: Last Modified date of a file based on partial name

    The filepath is correct. If I run it with the full name of the file, it works properly. The problem is in the partial filename.

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    12,948

    Re: Last Modified date of a file based on partial name

    It's hard to test without getting into it a bit.

    Possibly try. Although most people say you can't open a file using wildcards.

    Please Login or Register  to view this content.
    Last edited by davesexcel; 10-18-2019 at 12:51 PM.

+ 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. Open file based on date modified
    By LMoir87 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-28-2018, 10:46 AM
  2. How to check Last Modified Date on Temp File and compare it to original/parent file?
    By CaffeinatedCoder in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2016, 07:42 PM
  3. Getting File Modified Date from FTP, using VBA
    By Olly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-10-2014, 12:58 PM
  4. Update cell based on Modified date from another file type.
    By Mrcoop in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2014, 10:59 AM
  5. Finding File Creation date, saved date and last modified date
    By david systems in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-22-2013, 05:49 PM
  6. open the newest excel file in a folder based on modified date
    By dulitul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2013, 12:52 PM
  7. Format to open file based on Date Modified stamp
    By cabinetguy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2011, 02:22 PM

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