Link to home
Start Free TrialLog in
Avatar of nike_golf
nike_golfFlag for Afghanistan

asked on

Last user and file open date?

Is it possible to get the last user that opened a workbook and when that date was not using a macro in the actual workbook?  However it would be OK to use another workbook and VBA to get the stats.

Can this be done via the API to get the file information?

Looking for some ideas and thoughts but they can't be directed at using the actual workbook and VBA to achieve this.

NG,
Avatar of nike_golf
nike_golf
Flag of Afghanistan image

ASKER

I had already seen this code posted but this involves running a macro in the actual workbook and won't work.


Private Sub Workbook_Open()

' Stores who and when on Sheet1, column A
Sheets("Sheet1").Select

If Range("A65536").End(xlUp).Row = 1 And Range("A65536").End(xlUp).Value = "" Then
Range("A65536").End(xlUp).Value = "Last opened by " & Environ("username") & " at " & Now
Exit Sub
End If

Range("A65536").End(xlUp).Offset(1, 0).Value = "Last opened by " & Environ("username") & " at " & Now

End Sub
Avatar of Rory Archibald
You can use Windows security to audit file access. Unless the user changed and saved the workbook, the information will not be stored as a file property as far as I know.
How would you profess that would work?

The file that is to be accessed is on a network share so its not on a central computer. I think the information would have to be somehow tied directly to the file.

Thoughts?

NG,
The server can be set up to audit file access - I don't know the exact details offhand as it's a Windows thing not Excel and it's been many years since I was a network admin.
I am looking for a more user level approach.

NG,
The only alternative I can think of would be an addin on each machine that monitored each file opened checking for a particular name and then logged the access to it.
ASKER CERTIFIED SOLUTION
Avatar of nike_golf
nike_golf
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Self Answered