Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
tjc tjc is offline
external usenet poster
 
Posts: 13
Default Last modified date of a linked file

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Last modified date of a linked file

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?

  #3   Report Post  
Posted to microsoft.public.excel.misc
tjc tjc is offline
external usenet poster
 
Posts: 13
Default Last modified date of a linked file

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?

  #4   Report Post  
Posted to microsoft.public.excel.misc
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?

  #5   Report Post  
Posted to microsoft.public.excel.misc
tjc tjc is offline
external usenet poster
 
Posts: 13
Default Last modified date of a linked file

Thanks Joel. This code works great.
For my purposes, is there a way to use a cell reference that would be
updated when along with other links in the worksheet instead of the string
reference?



"Joel" wrote:

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?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Last modified date of a linked file

A String is a String is a String. Doesn't matter where it comes from. If
you have a cell that is text then
=lastsaved(A1)

where A1 = "c:\temp\book1.xls"


"tjc" wrote:

Thanks Joel. This code works great.
For my purposes, is there a way to use a cell reference that would be
updated when along with other links in the worksheet instead of the string
reference?



"Joel" wrote:

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?

  #7   Report Post  
Posted to microsoft.public.excel.misc
tjc tjc is offline
external usenet poster
 
Posts: 13
Default Last modified date of a linked file

Thanks Joel. I haven't figured out how to convert an active cell reference
to text. In this case, I'm trying to use the code you provided to get the
last saved date of a file referenced in another cell. For example,

cell A1 contains =c:\temp\book1.xls!A1 which returns the value in A1

In cell B1, I'm trying to get the last saved date of book1.xls in such a way
that it will update as the file referenced in A1 is changed through update
links. I've tried a version of =lastsaved(mid(A1,2,18)) which doesn't work
since A1 returns a value instead of the cell referenced.



"Joel" wrote:

A String is a String is a String. Doesn't matter where it comes from. If
you have a cell that is text then
=lastsaved(A1)

where A1 = "c:\temp\book1.xls"


"tjc" wrote:

Thanks Joel. This code works great.
For my purposes, is there a way to use a cell reference that would be
updated when along with other links in the worksheet instead of the string
reference?



"Joel" wrote:

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?

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Last modified date of a linked file

You don't have to convert. Any cell in text format will be passed in to the
function correctly.

"tjc" wrote:

Thanks Joel. I haven't figured out how to convert an active cell reference
to text. In this case, I'm trying to use the code you provided to get the
last saved date of a file referenced in another cell. For example,

cell A1 contains =c:\temp\book1.xls!A1 which returns the value in A1

In cell B1, I'm trying to get the last saved date of book1.xls in such a way
that it will update as the file referenced in A1 is changed through update
links. I've tried a version of =lastsaved(mid(A1,2,18)) which doesn't work
since A1 returns a value instead of the cell referenced.



"Joel" wrote:

A String is a String is a String. Doesn't matter where it comes from. If
you have a cell that is text then
=lastsaved(A1)

where A1 = "c:\temp\book1.xls"


"tjc" wrote:

Thanks Joel. This code works great.
For my purposes, is there a way to use a cell reference that would be
updated when along with other links in the worksheet instead of the string
reference?



"Joel" wrote:

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?

  #9   Report Post  
Posted to microsoft.public.excel.misc
tjc tjc is offline
external usenet poster
 
Posts: 13
Default Last modified date of a linked file

Thanks Joel. I got the answer to converting file name referenced in a
formula to text in another post ("Show cell reference as text"). Combined
with your LastSaved UDF, my problem is completely solved.

"Joel" wrote:

You don't have to convert. Any cell in text format will be passed in to the
function correctly.

"tjc" wrote:

Thanks Joel. I haven't figured out how to convert an active cell reference
to text. In this case, I'm trying to use the code you provided to get the
last saved date of a file referenced in another cell. For example,

cell A1 contains =c:\temp\book1.xls!A1 which returns the value in A1

In cell B1, I'm trying to get the last saved date of book1.xls in such a way
that it will update as the file referenced in A1 is changed through update
links. I've tried a version of =lastsaved(mid(A1,2,18)) which doesn't work
since A1 returns a value instead of the cell referenced.



"Joel" wrote:

A String is a String is a String. Doesn't matter where it comes from. If
you have a cell that is text then
=lastsaved(A1)

where A1 = "c:\temp\book1.xls"


"tjc" wrote:

Thanks Joel. This code works great.
For my purposes, is there a way to use a cell reference that would be
updated when along with other links in the worksheet instead of the string
reference?



"Joel" wrote:

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?

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
File Properties Modified Date not changing ALEX Excel Discussion (Misc queries) 0 February 6th 07 02:59 PM
date file modified Matthew Excel Discussion (Misc queries) 2 October 11th 06 06:52 PM
Excel File Open Box - want Date Modified Titian Excel Discussion (Misc queries) 2 February 26th 06 08:25 AM
insert the date the file was last modified Hoff Excel Discussion (Misc queries) 8 November 21st 05 01:31 PM
How do I add the file last modified date into an Excel header? John_Ostar Excel Discussion (Misc queries) 3 October 10th 05 10:20 PM


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