Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|