File Creation Date

T

Thomas M.

Excel 2007

I have a need to insert the file creation date into a workbook. I could
swear that I've done this before, in earlier versions of Excel.
However, I'm not real familiar with Excel 2007 yet and I'm having a hard
time figure out how to do this. I went to the Formulas ribbon and then
to Insert Function and looked through the date and time functions, but
did not see what I need.

Is there a way to insert the file creation date into an Excel workbook?

--Tom
 
R

Rob van Gelder

You'll need to create a user defined function.
Alt+F11 to get to VBA, then Insert > Module.

Paste the following code:

Function CreationDate() As Date
CreationDate = ThisWorkbook.BuiltinDocumentProperties("Creation Date")
End Function


You can then use the function in a workbook as follows:
=CreationDate()

However, you may notice it returns a number (like 40155), so you'll need to format the cell as a Date.


Cheers,
Rob
 
T

Thomas M.

Thanks for the reply, and I apologize for taking so long to follow up on
this.

For some reason I'm having a problem getting UDFs to work. I did exactly as
you recommended, and the formula results in a #NAME? error. This happens
with *any* UDF that I try. I've opened another thread called "#NAME? Error
With User Defined Functions" in an attempt to get this problem resolved.

I suspect that your solution for the creation date question is spot on, so
let's consider this thread to be closed and I'll continue to work on solving
the larger UDF problem through the thread that I've started on that subject.
I'm sure your creation date solution will work once I get the UDF problem
solved.

--Tom
 
T

Thomas M.

It turns out that within 2 minutes of posting my reply, I got a solution to
my UDF problem in the other thread. I have confirmed that the solution
given for the creation date question does in fact work.

For those of you having a problem getting UDFs to work, the name of my other
thread on that topic is given below.

--Tom
 

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