+ Reply to Thread
Results 1 to 3 of 3

Finding File Time

  1. #1
    Registered User
    Join Date
    11-18-2011
    Location
    Dorset
    MS-Off Ver
    Excel 365
    Posts
    37

    Finding File Time

    If I have, say, in a Cell the formula =Cell(FileName",A1), that generates the name of the curreent file.

    Or I might have, in a Cell, a "Value" such as
    ="C:\MyFolder\MyFile.TXT"

    How can I use this value to find the "Date / Time " stamp?

    Yes, I know there are several "styles" of these -
    Created, Modified, Accessed, archived, completed, last saved, received, released, sent, taken, deleted, any more ?
    so I also need to be able to specify which style.

    I haven't managed to find a "built-in" function - is there one ?

    So - if not - some ideas, please, for a VBA Function, so that I can use the formula
    = FileTime ( B3, myStyle )

    And of course I would then want to modify that for FileSize, FileShortName and FileAttr ;-)
    Last edited by RobinClay; 08-15-2019 at 02:13 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Finding File Time

    Here is a VBA that you can modify for your particular objects you wish to find. It should give you an idea of a possible direction to pursue if I am understanding your request.

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Finding File Time

    You can access following 3 datetime using Scripting.FileSystemObject.
    DateCreated, DateLastModified, DateLastAccessed

    Archived is just an attribute on the file object and note datetime. Assuming it was archived, then last modified should be the archived date.
    Other datetime / attributes you listed, does not exist in file object record.

    Ex:
    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

+ 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. Replies: 10
    Last Post: 03-24-2019, 11:57 AM
  2. Finding a file in folder based on first 2 numbers in file name
    By georgemaka in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2015, 06:42 PM
  3. [SOLVED] Time in Time format and text foramt - Finding the Hours difference
    By thilag in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-19-2013, 07:14 AM
  4. [SOLVED] Finding a file in sub folders and taking you to the location of searched file
    By subbby in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 10-09-2013, 01:25 PM
  5. Finding a line in a text file, offset x rows, and copy everything else in the file
    By new.vbacoder in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-27-2010, 12:53 PM
  6. Finding data on a dump file, populating rows in a summary file
    By SBells in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-21-2008, 08:29 AM
  7. Finding File Creation Time
    By bassoonboy in forum Excel General
    Replies: 0
    Last Post: 07-17-2006, 10:44 AM

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