Thread: Modify on close
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
acss acss is offline
external usenet poster
 
Posts: 38
Default Modify on close

Thanks Doug,

The idea is that i want to track when a user opens the workbook. I am using
sharepoint and it only alerts me when a change has been doen to the file but
i want to be alerted as to when someone actually opens the workbook...can
this be done???

"Doug Glancy" wrote:

I thought of doing as Gary suggests, but the user could choose not to save
changes at the close, so the modified date wouldn't change. I also thought
of change the BuiltInDocumentProperties("Time Last Saved") in the
BeforeClose event, but that's a change to the workbook and is only kept if
the user saves.

I don't think there is any way to guarantee showing it as saved without
saving it. So you can save it in the WorkBook_Open or the
WorkBook_BeforeClose module. The first will not save any changes that the
user makes later. The second will save their changes but will show the
saved time as the time when they closed the workbook, which is maybe what
you want judging from the title of this post.

These are workbook level events, so you need to paste the one you choose
into the ThisWorkbook module.

Private Sub Workbook_Open()
Me.Save
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Save
End Sub

hth,

Doug

"acss" wrote in message
...
I need to have the status of a workbook changed to modified even though a
user has not made any changes. Is there a way to do this so when the user
opens and views the file its status automatically changes?