View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Greg in CO[_2_] Greg in CO[_2_] is offline
external usenet poster
 
Posts: 50
Default Last Save date/time and User for a specific sheet in a shared

Hi! Me again........

The fiddling continues...I looked up the
ActiveWorkbook.BuiltinDocumentProperties to return the date and time...and
this appears to be working on each worksheet. I will need to test the file
in a shared mode.

The time, however, is still off by a minute or so.

If you can adjust your original formula to show the date, I will use that,
as it worked without issue.

Thanks!!!!

:)

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Range("h2").Value = ActiveWorkbook.BuiltinDocumentProperties(12)
Range("H3").Value = ActiveWorkbook.BuiltinDocumentProperties(7)
End Sub
--
Greg


"Greg in CO" wrote:

Hi Gary!

So, in trying to resolve/learn how to do this myself, I fiddled with the
function and now have this:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Range("h1").Value = BuiltinDocumentProperties("Last Save Time").Value
Range("H2").NumberFormat = "[$-F400]h:mm:ss AM/PM"
Range("H3").Value = ActiveWorkbook.BuiltinDocumentProperties(3)
End Sub

I rearranged the arguements so that the cells are in order (H1,H2,H3) and
inserted the BuiltinDocumentProperties("Last Save Time").Value in hopes that
it might return the date and the time together. It did, but was a minute or
two off, even though the file Properties showed the last save time correctly.
Also, with the new arguement for H1, the "[$-F400]h:mm:ss AM/PM" for H2
ceased to function entirely.

I am getting the date and time, but I am not sure if it is actually posting
the Save date and Time for each sheet. If I go to a differnt sheet (not new)
and I hit Save 3 times in succession in a couple of seconds, it will post the
current date and the time about 1-2 miutes off, then 1 minute off and then
the correct time, as if there is a dealy in the time stamp.

Bizzare!

I liked your original formula and the times were correct...what do I need to
do to get the date with it as well?

Thanks Mucho!
--
Greg


"Greg in CO" wrote:

Hi All!

I have a shared workbook which will h ave several users. I would like to
enter a UDF so that in a cell at the top of each worksheet, it will post the
last time that worksheet was saved and who saved it. I have found several
batches of code here that come close, but I do not want the the date/time and
user from a save on Worksheet A to show up on Worksheet B. Is this possible
or does Excel only show the saves for the workbook?

Ideally, if Fred and Ethel are working in the shared book, Fred on SheetA
and Ethel on SheetB, and Fred saves at 9:00 and Ethel saves at 9:15, when
someone else opens the workbook, on SheetA, they will see:

Last Saved: 09:00
Last Saved by: Fred Mertz

and on SheetB:

Last Saved: 09:15
Last Saved by: Ethel Mertz

I would like these two cells to be updated as soon as there is a save action
on the specific sheet.

Also, what should be entered into the cells?

Thanks!
--
Greg