File access log

lbour

New Member
Joined
Nov 21, 2005
Messages
34
Office Version
  1. 365
Platform
  1. Windows
Does Excel have the ability to track who uses a particular file? I'm trying to learn how to create a log that keeps track of and automatically updates itself when users access a particular Excel file. The Excel file is password protected, so they'll have to input their password, so it seems that an information trail would exist. I just don't know how to capture that info.

Thanks in advance for any suggestions, advice or help!

Lee
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Put this in the WorkBook_Open sub.
Code:
Private Sub Workbook_Open()
Dim UserName as String
Const strTextFileName As String = "C:\UserLog.Log"
Dim intHandle As Integer
MyUserName= Application.username
intHandle = FreeFile
If Dir(strTextFileName) = "" Then
    Open strTextFileName For Output As #intHandle
Else
    Open strTextFileName For Append As #intHandle
End If
Print #intHandle, MyUserName; Date
Close #intHandle
End Sub

Change the path C:\UserLog.Log to whatever you wish, each time the workbook is opened it will automatically output the username to the log file.
 
Upvote 0
Thanks StevenD! Routine works like a charm!

I have a little bit of work on my side as I have 50+ stores each looking at some financial reporting documents. Ideally, I'd like to capture log-ins for all 50+ stores in a single UserLog.log type file so I don't have 50+ individual .log files to look at.

I'm thinking that I can change the .log from a text file to .xls and create an Excel file with columns for each store that gets automatically updated.

You've given me a great starting point! Thanks again!
 
Upvote 0
Hi - I'm not exactly sure how it works, but I've heard if you have Outlook you can track documents and files with it's Journal Feature... you'll have to check out though :)

luc
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,852
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top