Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default File Information??

If I have the path to a file in A1. Is there a way that I could get the
informatin about when the file was created to appear in B1?


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default File Information??

Ian,

Just add this function to your workbook,

Public Function GetDate(rng)
Dim FileName As String
Dim DSO As Object
If TypeName(rng) = "Range" Then
If rng.Cells.Count 1 Then
GetDate = CVErr(xlErrRef)
Exit Function
End If
FileName = rng.Value
Else
FileName = rng
End If

Set DSO = CreateObject("DSOleFile.PropertyReader")
With DSO.GetDocumentProperties(sfilename:=FileName)
GetDate = .DateCreated
End With
End Function



Call like

=GetDate(A1)

or

=GetDate("C:\myTest\volker1.xls")

You do need to have the DSO dll installed and registered?

http://support.microsoft.com/?id=224351

set the section "Steps to Setup and Test"


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ianripping " wrote in message
...
If I have the path to a file in A1. Is there a way that I could get the
informatin about when the file was created to appear in B1?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default File Information??

How would you do the above Loadhigh

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default File Information??

Like so

Dim oFile As Object

Set oFSO = CreateObject("Scripting.FilesystemObject")
Set oFile = oFSO.getFile("C:\myTest\volker1.xls")
MsgBox "Created on " & oFile.Datecreated


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ianripping " wrote in message
...
How would you do the above Loadhigh?


---
Message posted from http://www.ExcelForum.com/



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
Import file information nickodemos Excel Discussion (Misc queries) 0 April 22nd 09 09:45 PM
Getting information from one excel file into another? coach Excel Discussion (Misc queries) 1 April 18th 09 04:18 AM
Displaying row information in another file Jeff Weinberg Excel Worksheet Functions 1 March 19th 07 04:33 PM
Using information in one excel file in another Andrew Pickles Excel Worksheet Functions 0 January 15th 07 01:01 PM
file information Stuart[_12_] Excel Programming 3 November 29th 03 12:37 AM


All times are GMT +1. The time now is 02:59 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"