E
ExcelMonkey
I know I can record when a file is opened by writing a
routine that triggers off the open event in This Workbook.
It writes my username to a text file as seen below:
Private Sub Workbook_Open()
Open ThisWorkbook.Path & "\usage.log" For Append As #1
Print #1, Application.UserName, Now
Close #1
End Sub
It creates a text file that reads like this:
ExcelMonkey 04/02/2005 10:21:59
ExcelMonkey 04/02/2005 10:37:04
ExcelMonkey 04/02/2005 10:38:04
However, I also want it to write when I exit the file and
calculated the amount of time I was in it. To do this I
will have to trigger another routine with a Close Event.
It will then have to open this same text file and record
the exit time and calc a duration. I twill read like this:
Me 04/02/2005 10:21:59 04/02/2005 10:22:59 00:01:00
Me 04/02/2005 10:37:04 04/02/2005 10:38:04 00:01:00
Me 04/02/2005 10:38:04 04/02/2005 10:39:04 00:01:00
Does anyone know how to do this?
routine that triggers off the open event in This Workbook.
It writes my username to a text file as seen below:
Private Sub Workbook_Open()
Open ThisWorkbook.Path & "\usage.log" For Append As #1
Print #1, Application.UserName, Now
Close #1
End Sub
It creates a text file that reads like this:
ExcelMonkey 04/02/2005 10:21:59
ExcelMonkey 04/02/2005 10:37:04
ExcelMonkey 04/02/2005 10:38:04
However, I also want it to write when I exit the file and
calculated the amount of time I was in it. To do this I
will have to trigger another routine with a Close Event.
It will then have to open this same text file and record
the exit time and calc a duration. I twill read like this:
Me 04/02/2005 10:21:59 04/02/2005 10:22:59 00:01:00
Me 04/02/2005 10:37:04 04/02/2005 10:38:04 00:01:00
Me 04/02/2005 10:38:04 04/02/2005 10:39:04 00:01:00
Does anyone know how to do this?