Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Record who opens a excel file

Is it possible to record who opens and saves something to the excel file??
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.misc
RCW RCW is offline
external usenet poster
 
Posts: 9
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel file opens with a colon followed by a number in the Excel Title Bar [email protected] Excel Discussion (Misc queries) 4 December 21st 06 04:00 PM
Excel file opens but no worksheets visible SELIGMAN MAINE Excel Discussion (Misc queries) 3 July 5th 06 10:32 PM
Excel file with hyperlinks takes a long time to open over the network Didier P Links and Linking in Excel 3 July 4th 06 04:39 PM
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
when i open a file a new excel window opens. how do stop this susan Excel Discussion (Misc queries) 1 July 1st 05 03:08 PM


All times are GMT +1. The time now is 11:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"