Macro to obtain creation date of the excel file

  • Thread starter Thread starter Just Merks
  • Start date Start date
J

Just Merks

Hello,

An oracle datbase is providing me with an formatted excel sheet. I created a
macro to manipulate the data for my own purpose.
Now I want to save the file as being modified, but want to put the date an
time of the creation into the file name.

Any suggestions?

regards,

Just
 
Maybe this:

ActiveWorkbook.SaveAs Filename:="MyFile" & Now() & ".xls"

Regards,
Per
 
Per,

Thank you for your response, but this would concetenate the current time,
and I would like to obtain the initial creation date of the file.

regards,

Just
 
Sub filedateonly()
mystamp = FileDateTime("c:\a\openit.xls")
MsgBox mystamp
End Sub
FileDateTime Function


Returns a Variant (Date) that indicates the date and time when a file was
created or last modified.

Syntax

FileDateTime(pathname)

The required pathname argument is a string expression that specifies a file
name. The pathname may include the directory or folder, and the drive.
 
Back
Top