View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Last modified date of a linked file

Simple. We change the macro to a function

call function with a string name of a file in double quotes
=lastsaved("c:\temp\book1.xls")

Function lastsaved(FileName As String)
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(FileName)
lastsaved = f.datelastmodified
End Function


"tjc" wrote:

Thanks Joel.
But, I'm looking for a user defined function. Maybe something along the
lines of
=lastsaved(c:/otherfile!A1)


"Joel" wrote:

Sub getfiles()

Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile("c:\temp\book1.xls")
MsgBox ("last Modified = " & f.datelastmodified)
End Sub

"tjc" wrote:

I've seen several posts on how to display last saved date for the active
workbook, but I'm searching for the last saved date of a linked file. Can
anyone suggest a way to use BuiltInDocumentProperties with a reference to the
another file?