Macro to obtain creation date of the excel file

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
 
P

Per Jessen

Maybe this:

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

Regards,
Per
 
J

Just Merks

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
 
D

Don Guillett

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top