+ Reply to Thread
Results 1 to 4 of 4

Dates within file names

  1. #1
    Registered User
    Join Date
    12-18-2007
    Location
    London, UK
    MS-Off Ver
    MS Office 2007 & 2010
    Posts
    19

    Post Dates within file names

    I am able to find a file with the name

    Book1_ddmmyyyy.xls

    using

    currentDate1 = Format(Date, "DD") & Format(Date, "MM") & Format(Date, "YY")



    filePath0 = "Book1_" & currentDate1 & ".xls"


    However, I need to be able to open the following

    Book1_dd-mmm-yyyy.xls

    I have tried to adjust my currentDate1 formula, but can not get it right as it tells me
    "the file "Book1_" does not exist"


    Anyone able to assist?

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Dates within file names

    Try this:

    Please Login or Register  to view this content.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    12-18-2007
    Location
    London, UK
    MS-Off Ver
    MS Office 2007 & 2010
    Posts
    19

    Re: Dates within file names

    Thanks Dave, I have already tried this, but had no success, it just returns:

    Book1_

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Dates within file names

    Then there is a problem with the code that you have not shown. Step through the code and see what filePath0 is right after you give it a value.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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