#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default UDF Help.

Please help a newbie.

Could anyone, kindly, show me how I can program a UDF to
make a content of a cell, return "the last time the spread
sheet was saved". This cell in question is part of the
same spread sheet.

I'm running Excel 97.

The save function can be (both) when the file is still open
or right before it's closed. The content of a cell should
reflect (in date format) when the sheet is saved.

Thanks in advance.

Yppes
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default UDF Help.

Yppes,

This function does the trick:

Function getLastSaved()
Dim FSO
Dim f
Set FSO = CreateObject("Scripting.FileSystemObject")
Set f = FSO.GetFile(ActiveWorkbook.FullName)
getLastSaved = f.DateLastModified
Set FSO = Nothing
Set f = Nothing
End Function

This returns a string in date/time format, such as "7/24/2004 5:05:32 PM".
You can take it from there.

Stan Scott
New York City

"Yppes" wrote in message
...
Please help a newbie.

Could anyone, kindly, show me how I can program a UDF to
make a content of a cell, return "the last time the spread
sheet was saved". This cell in question is part of the
same spread sheet.

I'm running Excel 97.

The save function can be (both) when the file is still open
or right before it's closed. The content of a cell should
reflect (in date format) when the sheet is saved.

Thanks in advance.

Yppes



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default UDF Help.


Function LastSaved()
LastSaved = ActiveWorkbook. _
BuiltinDocumentProperties("Last Save Time")
End Function

make sure that you format the target cell.

--

HTH

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

"Yppes" wrote in message
...
Please help a newbie.

Could anyone, kindly, show me how I can program a UDF to
make a content of a cell, return "the last time the spread
sheet was saved". This cell in question is part of the
same spread sheet.

I'm running Excel 97.

The save function can be (both) when the file is still open
or right before it's closed. The content of a cell should
reflect (in date format) when the sheet is saved.

Thanks in advance.

Yppes



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default UDF Help.

Just some additional information:
using built in document properties
Excel 97 doesn't maintain the builtin document propert Last Save Time

using FSO to look at file properties
When a file is opened, its DateLastModified is set to the time it was
opened. If you subsequently save it in that session, then that function
might work.

--
Regards,
Tom Ogilvy

"Yppes" wrote in message
...
Please help a newbie.

Could anyone, kindly, show me how I can program a UDF to
make a content of a cell, return "the last time the spread
sheet was saved". This cell in question is part of the
same spread sheet.

I'm running Excel 97.

The save function can be (both) when the file is still open
or right before it's closed. The content of a cell should
reflect (in date format) when the sheet is saved.

Thanks in advance.

Yppes



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



All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"