+ Reply to Thread
Results 1 to 2 of 2

Finding File Creation date, saved date and last modified date

  1. #1
    Registered User
    Join Date
    10-17-2013
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    5

    Finding File Creation date, saved date and last modified date

    Hi all,

    I could use some advice on where I am going wrong here. I have written code that will allow a user to open a file import it use the data and then send it off. What I would like to do now is find the creation date and time, last saved date and time, and last modified date in time and display it in a new tab i made. The new tab already shows the time the file was opened.

    sub Log ()

    Dim dtmDate As Date
    Dim LogRow As Long
    Dim ModDate As Date


    ThisWorkbook.Activate
    Sheets("Log").Select
    LogRow = Worksheets("Log").Cells(Rows.Count, 2).End(xlUp).Row 'sets var to the last row in column B. To be used as a counter for the Log

    Range("B" & LogRow + 1) = .UserId
    Range("C" & LogRow + 1) = FileName ' file name is a public var
    dtmDate = Now
    Range("D" & LogRow + 1) = dtmDate

    ****** I get the Error in the next Row Range("F" & LogRow + 1).Value**********************

    Range("F" & LogRow + 1).Value = Format(Windows(FileName).BuiltinDocumentProperties("Creation Date"), "m/d/yy h:n ampm")
    Range("G" & LogRow + 1).Value = Format(Windows(FileName).BuiltinDocumentProperties("Last Save Time"), "m/d/yy h:n ampm")
    ModDate = Format(FileDateTime(Windows(FileName).FullName), "m/d/yy h:n ampm")
    Range("H" & LogRow + 1) = ModDate

    End Sub


    Any suggestions on what I am doing wrong with the builtinDocument Properties.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Finding File Creation date, saved date and last modified date

    I think last saved date and time is the same as the date last modified:

    Please Login or Register  to view this content.

+ 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. Template needed with footer containing date created and date modified
    By MitchHull in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-31-2012, 04:37 PM
  2. Finding the last modified date on a file
    By koltregaskes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-25-2011, 05:03 AM
  3. Excel file creation dates do not match the windows creation date.
    By alexthapyro in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2011, 12:14 PM
  4. Set a file's modified date?
    By Ken Loomis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2005, 09:05 PM
  5. [SOLVED] Printing the last modified or saved date in the header/footer
    By Magster in forum Excel General
    Replies: 1
    Last Post: 03-08-2005, 12:06 PM

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