Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
File Creation Date Thomas M.[_2_] Excel Worksheet Functions 3 January 5th 10 01:15 AM
How can I get date of file creation to XLS cell in date format? Radek Simek Excel Worksheet Functions 3 November 8th 07 04:24 PM
Custom Document Properties - Last Calculation Date Zani Excel Programming 2 February 22nd 06 10:49 PM
file creation date munken Excel Worksheet Functions 2 August 31st 05 01:40 PM
accessing custom document properties without loading file [email protected] Excel Programming 2 September 30th 04 01:47 AM


All times are GMT +1. The time now is 12:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"