Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dd dd is offline
external usenet poster
 
Posts: 95
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
dd dd is offline
external usenet poster
 
Posts: 95
Default 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
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
Macro To Print Files By A Listing of Filenames And Paths Chris_In_Raleigh Excel Programming 0 November 7th 06 07:58 PM
VBA and File System Object [email protected] Excel Programming 3 September 7th 06 06:21 PM
File System Object Jason Zischke Excel Programming 3 August 30th 06 07:52 AM
Help with filenames and paths. jim9912 Excel Discussion (Misc queries) 2 March 30th 06 05:52 PM
File System Object Neil Excel Programming 2 September 10th 03 05:01 PM


All times are GMT +1. The time now is 04:21 AM.

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"