Tracking Document Usage

  • Thread starter Thread starter Diana
  • Start date Start date
D

Diana

I am wondering if there is anyway I can track the usage
of a certain excel spreadsheet. For instance: how many
times this spreadsheet was opened per month.

Thank you for you input on this.
Diana
 
Diana,

One way......

In the Workbook_Open event handler:

Private Sub Workbook_Open()
Open ThisWorkbook.Path & "\my.log" For Append As #1
Print #1, Application.Username, Now, "Opened"
Close #1
End Sub

The above will create a textfile named "my.log" in the
same directory that the workbook is in (you can modify this
if you want to put it somewhere else).
If the file doesn't exist, it will create it.
Every time someone opens the workbook, it'll add an
entry to that log file with the Username, date & time and the
word "Opened"

You can use the same scenario to log other events if
you want.

To install the above code, Press Alt + F11
Double click on "ThisWorkbook" in the "Projects"
window and copy and paste the above code into the
panel on the right.

John
 
Back
Top