Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify File Creation date in VBA using Document properties
Good afternoon, all.
Is there a reason why the following doesn't work? Sub ChangeCreationDate() ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date:").Value = "06/03/07" End Sub Does the date have to be in a particular format, or it is simply because there are some properties you just can't change? Thanks in advance Pete |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify File Creation date in VBA using Document properties
You have to use the correct name.
From the immediate window as a demonstration: ? ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date").Value 3/8/2006 10:16:50 AM ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date").Value = "2/25/1987" ? ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date").Value 2/25/1987 This will be reflected under the statistics tab in Properties. -- Regards, Tom Ogilvy "Peter Rooney" wrote in message ... Good afternoon, all. Is there a reason why the following doesn't work? Sub ChangeCreationDate() ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date:").Value = "06/03/07" End Sub Does the date have to be in a particular format, or it is simply because there are some properties you just can't change? Thanks in advance Pete |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify File Creation date in VBA using Document properties
Tom, Thanks for this. So, there's nothing I can do about entries in the
General tab, then? Regards Pete "Tom Ogilvy" wrote: You have to use the correct name. From the immediate window as a demonstration: ? ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date").Value 3/8/2006 10:16:50 AM ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date").Value = "2/25/1987" ? ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date").Value 2/25/1987 This will be reflected under the statistics tab in Properties. -- Regards, Tom Ogilvy "Peter Rooney" wrote in message ... Good afternoon, all. Is there a reason why the following doesn't work? Sub ChangeCreationDate() ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date:").Value = "06/03/07" End Sub Does the date have to be in a particular format, or it is simply because there are some properties you just can't change? Thanks in advance Pete |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify File Creation date in VBA using Document properties
I believe those are taken from the file system. You would need to use the
Windows API or maybe one of the scripting tools (scripting runtime/file system object perhaps) to modify them after you closed the file if that is possible - which I can't say if it is possible off the top of my head). -- Regards, Tom Ogilvy "Peter Rooney" wrote in message ... Tom, Thanks for this. So, there's nothing I can do about entries in the General tab, then? Regards Pete "Tom Ogilvy" wrote: You have to use the correct name. From the immediate window as a demonstration: ? ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date").Value 3/8/2006 10:16:50 AM ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date").Value = "2/25/1987" ? ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date").Value 2/25/1987 This will be reflected under the statistics tab in Properties. -- Regards, Tom Ogilvy "Peter Rooney" wrote in message ... Good afternoon, all. Is there a reason why the following doesn't work? Sub ChangeCreationDate() ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date:").Value = "06/03/07" End Sub Does the date have to be in a particular format, or it is simply because there are some properties you just can't change? Thanks in advance Pete |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify File Creation date in VBA using Document properties
Try
ThisWorkbook.BuiltinDocumentProperties("Creation Date").Value = Now -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Peter Rooney" wrote in message ... Good afternoon, all. Is there a reason why the following doesn't work? Sub ChangeCreationDate() ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date:").Value = "06/03/07" End Sub Does the date have to be in a particular format, or it is simply because there are some properties you just can't change? Thanks in advance Pete |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify File Creation date in VBA using Document properties
Chip, it changes the value on the "Statistics" tab, but the value in the
"General" tab remains unchanged. Cheers Pete "Chip Pearson" wrote: Try ThisWorkbook.BuiltinDocumentProperties("Creation Date").Value = Now -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Peter Rooney" wrote in message ... Good afternoon, all. Is there a reason why the following doesn't work? Sub ChangeCreationDate() ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date:").Value = "06/03/07" End Sub Does the date have to be in a particular format, or it is simply because there are some properties you just can't change? Thanks in advance Pete |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify File Creation date in VBA using Document properties
Tom,
It all sounds a bit complex for my tiny brain, although I'm at a loss to understand why : ThisWorkbook.BuiltinDocumentProperties("Creation Date").Value = Now alters the value in the "Statistics" tab, but not the "General" tab. Oh well, never mind - thanks for your interest :-) Pete "Tom Ogilvy" wrote: I believe those are taken from the file system. You would need to use the Windows API or maybe one of the scripting tools (scripting runtime/file system object perhaps) to modify them after you closed the file if that is possible - which I can't say if it is possible off the top of my head). -- Regards, Tom Ogilvy "Peter Rooney" wrote in message ... Tom, Thanks for this. So, there's nothing I can do about entries in the General tab, then? Regards Pete "Tom Ogilvy" wrote: You have to use the correct name. From the immediate window as a demonstration: ? ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date").Value 3/8/2006 10:16:50 AM ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date").Value = "2/25/1987" ? ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date").Value 2/25/1987 This will be reflected under the statistics tab in Properties. -- Regards, Tom Ogilvy "Peter Rooney" wrote in message ... Good afternoon, all. Is there a reason why the following doesn't work? Sub ChangeCreationDate() ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date:").Value = "06/03/07" End Sub Does the date have to be in a particular format, or it is simply because there are some properties you just can't change? Thanks in advance Pete |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify File Creation date in VBA using Document properties
Yeah, you're right. My mistake.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Peter Rooney" wrote in message ... Chip, it changes the value on the "Statistics" tab, but the value in the "General" tab remains unchanged. Cheers Pete "Chip Pearson" wrote: Try ThisWorkbook.BuiltinDocumentProperties("Creation Date").Value = Now -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Peter Rooney" wrote in message ... Good afternoon, all. Is there a reason why the following doesn't work? Sub ChangeCreationDate() ActiveWorkbook.BuiltinDocumentProperties.Item("Cre ation Date:").Value = "06/03/07" End Sub Does the date have to be in a particular format, or it is simply because there are some properties you just can't change? Thanks in advance Pete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
File Creation Date | Excel Worksheet Functions | |||
How can I get date of file creation to XLS cell in date format? | Excel Worksheet Functions | |||
Custom Document Properties - Last Calculation Date | Excel Programming | |||
file creation date | Excel Worksheet Functions | |||
accessing custom document properties without loading file | Excel Programming |