Notify when opened


Posted by deb on June 15, 2000 10:28 PM

Is there any way to find out who is opening your workbooks. I have a few workbooks that have info for public use. They come in look at what they want and then close the workbook. They don't save but i am curious to see who is looking at them.



Posted by JAF on June 16, 0100 7:11 AM

Deb

If you create a worksheet called Historic and add the following code to the ThisWorkbook object, this will keep a record of who opened the workbook (based on the user name input under Tools/Options/General) as well as the date and time the workbook was opened.

Private Sub Workbook_Open()
Application.ScreenUpdating = False
'
Dim user_details As Variant
user_details = Application.UserName & " - " & Now()
'
Sheets("Historic").Select
ActiveSheet.Unprotect Password:="PASSWORD"
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Range("A1").Value = user_details
ActiveSheet.Protect Password:="PASSWORD"
'
Sheets("Sheet1").Select
ActiveWorkbook.Save
Application.ScreenUpdating = True
End Sub


JAF