View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
RCW RCW is offline
external usenet poster
 
Posts: 9
Default Record who opens a excel file

You can create a separate text file with a similar name that records the
Excel and system log in names and the time the workbook was opened by pasting
this into a standard VBA module.

The Print#1, line ends in Now. You may need to fix that if it gets split
into two lines in the reply.

Sub Auto_Open()

' Use as part of an Auto_Open macro
' Change both occurances of C:\myExcelBackups to the desired
' path location for the File Use Log -i.e. a network drive?
' A text file will show the name and time of everyone who
' opens the workbook.

Application.DisplayAlerts = False
Dim FileUser As String
Dim FileUserDocFILE As String

FileUser = ActiveWorkbook.Name

On Error Resume Next
MkDir "C:\myExcelBackups"
FileUserDocFILE = "C:\myExcelBackups\" & FileUser & " Log.txt"
On Error GoTo 0

Open FileUserDocFILE For Append As #1
Print #1, Application.UserName & Environ("username") & " Opened " &
ActiveWorkbook.Name & " at " & Now
Close #1

Application.DisplayAlerts = True

End Sub

"louiscourtney" wrote:

Is it possible to record who opens and saves something to the excel file??