MrExcel Publishing
Your One Stop for Excel Tips & Solutions

create date as file name


Posted by atom on June 22, 2001 8:46 AM

hi! it's not specific excel but should be at least a similiar routine as for word: I'd like to have a batch to save a file (or multiple files) with its creation date as filename. any scripting solutions? thanks!
atom


Posted by Damon Ostrander on June 22, 2001 12:17 PM

Hi atom,

This is easy to do, but you didn't mention what files you wanted to save, so I can't provide a specific solution. For example, do you want to rename all files in a given folder? All documents open in Word? Or perhaps just the currently active workbook in Excel? Anyway, whatever it is can be easily done.

To access the creation date of any office document, just use the BuiltinDocumentProperties Property. For example, to save the currently active Excel workbook named by its date:

d = BuiltinDocumentProperties("Creation Date")

ThisWorkbook.SaveAs Format(d,"mmddyy")

Happy computing.

Damon