Document Tracking

H

hce

Dear all

Is it possible to track when a workbook is opened ... how man
times...? how long... when... etc... without the one opening th
workbook knowing that this tracking is happening...? could we get al
these info in a txt file created which the user is unaware...?

cheer
 
I

Ian R

hce > said:
Dear all

Is it possible to track when a workbook is opened ... how many
times...? how long... when... etc... without the one opening the
workbook knowing that this tracking is happening...? could we get all
these info in a txt file created which the user is unaware...?

cheers

Hi

If MS Outlook is on the same PC then the Journal can be enabled to record
some of this info. Have a look in the OL help files for more info.

HTH

Ian
 
F

Frank Kabel

Hi
I wrote a macro for this (see below):
---

- saves entries into a log file (e.g. log.xls. This file has to exist
as empty file prior to invoking this macro)
- could save additional fields as well
- adapt path name, file name, etc according to your situation
- put the macro in your workbook module 8not in a standard module)

And as additional comment: You mentioned that the user should not
recognize this kind of tracking:
- I don't know in which country you live but if you would do this in
Germany (as employer) you'll definetly get sued for this (especially if
you have a staff delegate).
- In Germany you have to inform the employees about this tracking and
in most cases your're NOT allowed to track on user base but just on an
aggregated level
- so be careful using tracking mechanism


-----------
Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim log_wbk As Workbook
Dim log_wks As Worksheet
Dim last_log_row As Long
Dim path As String
Dim log_filename As String
Dim source_wbk As Workbook
Dim source_wks As Worksheet


'Initialization
Application.ScreenUpdating = False
path = "C:\Temp\"
log_filename = "log.xls"
Set source_wbk = ActiveWorkbook


'check if logging workbook is open / if not open it
On Error Resume Next
Set log_wbk = Workbooks(log_filename)
On Error GoTo 0
If log_wbk Is Nothing Then
Workbooks.Open filename:=path & log_filename
Set log_wbk = Workbooks(log_filename)
End If
Set log_wks = log_wbk.Worksheets("Tabelle1") 'change this

'get last used row in the logging workbook
last_log_row = log_wks.Cells(Rows.Count, "A").End(xlUp).row

'log data - change to your needs
With log_wks
.Cells(last_log_row + 1, 1).Value = Application.UserName
.Cells(last_log_row + 1, 2).Value = _
Format(Now, "MM/DD/YYYY hh:mm:ss")

'save some cell values as audit trail
Set source_wks = source_wbk.Worksheets("Tabelle1")
.Cells(last_log_row + 1, 3).Value = source_wks.Range("A1").Value
.Cells(last_log_row + 1, 4).Value = source_wks.Range("A2").Value
End With


' save the changes
Application.DisplayAlerts = True
log_wbk.Save
log_wbk.Close
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
 
O

Otto Moehrbach

I don't know your operation or how secure you want this to be, but you can
easily gather all of this information and store it in a hidden or VeryHidden
sheet within the same file without the user being aware. Post back if you
need more. HTH Otto
 
H

hce

Hi Frank

Thanks for your help... this tracking thing is just for my persona
interest... i'm not going to monitor anything or whatsoever... anywa
thank you so much for your help and advice... you r really a exce
genius... u have helped me on so many occasions... how can i thank yo
enough....

cheer
 
Top