Reputation: 1
I've created an Excel report file and placed it in my office shared folder some of my office colleges have accessed and and edited the contents. How I can find the recently accessed username of that file...???
Upvotes: 0
Views: 74
Reputation: 50308
I've been using the "GetUserName()" function from here for years. Stick that in a new module, and then in the ThisWorkbook code you can use something like:
Private Sub Workbook_Open()
Dim lastRow As Integer
lastRow = Sheet1.Range("A" & Rows.Count).End(xlUp).Row
Sheet1.Cells(lastRow, 1).Value = GetUserName
Sheet1.Cells(lastRow, 2).Value = Now()
ThisWorkbook.Save
End Sub
Then, when anyone opens the workbook, it will stick their username from the computer and the date/time into Sheet1 and keep a log of it.
Upvotes: 0
Reputation: 52008
Excel 2010 and later has a track changes feature that, if enabled, will show the author of any change in a shared workbook. I don't think that it can be used to track mere access but your question refers to users who have accessed and edited the contents.
Upvotes: 3