ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date file created (https://www.excelbanter.com/excel-programming/375180-date-file-created.html)

Les Stout[_2_]

Date file created
 
Good day all, i need to get the date a file was created, is this
possible ? All i can find is date last modified.. Any help with code
would be appreciated

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

WhytheQ

Date file created
 
I see something by Tom that should help

Sub AAACCC()
Dim fso As Object
Dim f As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.Drives("A").RootFolder.Files("aa_Userform.xls" )
Debug.Print f.Name
Debug.Print "Created: " & f.DateCreated
Debug.Print "Last Accessed: " & f.DateLastAccessed
Debug.Print "Last Modified: " & f.DateLastModified
End Sub

Rgds
J



Les Stout wrote:

Good day all, i need to get the date a file was created, is this
possible ? All i can find is date last modified.. Any help with code
would be appreciated

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***



Bob Phillips

Date file created
 

'-----------------------------------------------------------------
Function DocProps(prop As String)
'-----------------------------------------------------------------
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function


and enter in a cell such as
=DocProps ("last author")
or
=DocProps ("creation date")


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Les Stout" wrote in message
...
Good day all, i need to get the date a file was created, is this
possible ? All i can find is date last modified.. Any help with code
would be appreciated

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***




Les Stout[_2_]

Date file created
 
Thank you both very much, i will try it out..

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

Les Stout[_2_]

Date file created
 
Hi Bob, please excuse the ignorance, but how do i call the function or
get it to give me what i need...

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

Les Stout[_2_]

Date file created
 
Hi Bob, sorry blonde moment... Have sorted it out thanks..

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

Bob Phillips

Date file created
 
Les,

You can call it from a worksheet

=DocProps ("creation date")

or within other code

madeDate = DocProps ("creation date")

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Les Stout" wrote in message
...
Hi Bob, please excuse the ignorance, but how do i call the function or
get it to give me what i need...

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***




Tom Ogilvy

Date file created
 
As Bob said, in a cell:

=DocProps ("creation date")


from VBA

dim v as Variant
v = DocProps("creation date")
if iserror(v) then
msgbox "Problems"
else
msgbox "Results are " & v
End if

--
Regards,
Tom Ogilvy




"Les Stout" wrote:

Hi Bob, please excuse the ignorance, but how do i call the function or
get it to give me what i need...

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***



All times are GMT +1. The time now is 03:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com