Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Record who opens a excel file
Is it possible to record who opens and saves something to the excel file??
|
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Record who opens a excel file
Store this small macro in ThisWorkbook code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Set r = Workbooks("B1.xls").Sheets("S1").Range("A1") r.Value = Environ("UserName") End Sub change the workbook and sheet names to suit you. If you are not familiar with VBA, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Gary's Student gsnu200701 "louiscourtney" wrote: Is it possible to record who opens and saves something to the excel file?? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Record who opens a excel file
You can create a separate text file with a similar name that records the
Excel and system log in names and the time the workbook was opened by pasting this into a standard VBA module. The Print#1, line ends in Now. You may need to fix that if it gets split into two lines in the reply. Sub Auto_Open() ' Use as part of an Auto_Open macro ' Change both occurances of C:\myExcelBackups to the desired ' path location for the File Use Log -i.e. a network drive? ' A text file will show the name and time of everyone who ' opens the workbook. Application.DisplayAlerts = False Dim FileUser As String Dim FileUserDocFILE As String FileUser = ActiveWorkbook.Name On Error Resume Next MkDir "C:\myExcelBackups" FileUserDocFILE = "C:\myExcelBackups\" & FileUser & " Log.txt" On Error GoTo 0 Open FileUserDocFILE For Append As #1 Print #1, Application.UserName & Environ("username") & " Opened " & ActiveWorkbook.Name & " at " & Now Close #1 Application.DisplayAlerts = True End Sub "louiscourtney" wrote: Is it possible to record who opens and saves something to the excel file?? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel file opens with a colon followed by a number in the Excel Title Bar | Excel Discussion (Misc queries) | |||
Excel file opens but no worksheets visible | Excel Discussion (Misc queries) | |||
Excel file with hyperlinks takes a long time to open over the network | Links and Linking in Excel | |||
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER | New Users to Excel | |||
when i open a file a new excel window opens. how do stop this | Excel Discussion (Misc queries) |