Creation Date

K

Kjell Forssen

Hi
Why doesn´t this code work?

ActiveWorkbook.SaveAs FName
Sheets("Offert").Select
Range("D13").Select
ActiveCell.Value = ActiveWorkbook.BuiltinDocumentProperties("Creation
Date")
 
B

Bob Phillips

It does work, but you might want to format it

ActiveCell.Value = Format(ActiveWorkbook.BuiltinDocumentProperties( _
"Creation Date"), "dd mmm yyyy hh:mm:ss")


--
HTH

Bob Phillips

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

macropod

Hi Kjell,

This should work:
With ActiveWorkbook
.SaveAs FName
.Sheets("Offert").Range("D13").Value = _
.BuiltinDocumentProperties("Creation Date")
End With

Cheers
 
K

Kjell Forssen

Hi again
Thank you for helping me.
It works as before wich means that I am getting the wrong date - its not the
templates date and not the date when the user template with the macros was
created and not todays date. It seems to me like if the worksheet has a
permanent date (20060418) wich not is changed when a new worksheet is created.
Great to hear from you again!
Kjell
 
M

macropod

Hi Kjell,

If the user saved the file using Save As, that might change the Creation
Date.

Cheers
 
Top