Tom’s Tutorials For Excel: Workbook Creation Date

Tom’s Tutorials For Excel: Workbook Creation Date

If you want to know the creation date and time of the active workbook:

Sub MyCreationDate()
Dim myDate As Date
myDate = ActiveWorkbook.BuiltinDocumentProperties("Creation date").Value
MsgBox Format(myDate, "mmmm d, yyyy at h:mm:ss AM/PM"), , _
"I was born on..."
End Sub

If you want to know the creation date and time of a closed or other workbook:

Sub CreationDateWB()
Dim objWB As Object, wbName As String, myDate As Double
wbName = "C:\Your\File\Path\YourWorkbookName.xls"
Set objWB = CreateObject("Scripting.FileSystemObject")
myDate = objWB.GetFile(wbName).DateCreated
MsgBox wbName & " was created on" & vbCrLf & _
Format(myDate, "mmmm d, yyyy at h:mm:ss AM/PM"), , "FYI..."
End Sub
Share Button
Posted in Tom's Tutorials for Excel
Tags: , , , , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*