Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using File System Object to retrieve paths filenames and dates
I have a workbook that works as a fileindex to show paths, files and
hyperlinks ot the files. Is there a way I can include the date the file was created (date attribute), as a new column to my worksheet? DDawson Scotland |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using File System Object to retrieve paths filenames and dates
The File object has a DateLastModified property... Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFile(fpath) str = f.DateLastModified -or- The free Excel add-in "List Files" does everything you describe plus a little bit more. Download from... http://www.realezsites.com/bus/primitivesoftware No registration required. -- Jim Cone San Francisco, USA "dd" <dd.dd wrote in message ... I have a workbook that works as a fileindex to show paths, files and hyperlinks ot the files. Is there a way I can include the date the file was created (date attribute), as a new column to my worksheet? DDawson Scotland |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using File System Object to retrieve paths filenames and dates
You can use this functtion
Function FileCreateDate(filespec) Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(filespec) FileCreateDate = f.DateCreated End Function call it from your worksheet using =FileCreateDate("c:\temp\book1.xls") "dd" wrote: I have a workbook that works as a fileindex to show paths, files and hyperlinks ot the files. Is there a way I can include the date the file was created (date attribute), as a new column to my worksheet? DDawson Scotland |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using File System Object to retrieve paths filenames and dates
Thanks very much for this.
Is there any way to format the date through VBA. I want it to show as DD/MM/YY The spreadsheet formating is not very reliable, some of the dates show the time of creatiion as well and I can't get rid of it. Thanks Dylan "Joel" wrote in message ... You can use this functtion Function FileCreateDate(filespec) Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(filespec) FileCreateDate = f.DateCreated End Function call it from your worksheet using =FileCreateDate("c:\temp\book1.xls") "dd" wrote: I have a workbook that works as a fileindex to show paths, files and hyperlinks ot the files. Is there a way I can include the date the file was created (date attribute), as a new column to my worksheet? DDawson Scotland |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro To Print Files By A Listing of Filenames And Paths | Excel Programming | |||
VBA and File System Object | Excel Programming | |||
File System Object | Excel Programming | |||
Help with filenames and paths. | Excel Discussion (Misc queries) | |||
File System Object | Excel Programming |