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.
Bookmarks