Jadvanianil
New Member
- Joined
- Feb 21, 2014
- Messages
- 19
Dear Team,
I have got a macro in an excel file which tracks the username and time of the users opening the file which I definitely need. The problem is that if 1 user opens the file and leaves it open then it doesn't track the name/time of other users who open the file when its in use. Is it anyway possible to track every user who opens the file even if the file is in use? I have copied the original code below. Many Thanks.
Option Explicit
Private LastRow As Long
Const HIDDEN_SHEET As String = "hidden"
Private Sub Workbook_Open()
Application.EnableEvents = False
With Worksheets(HIDDEN_SHEET)
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
.Range("A" & LastRow).Value = Environ("UserName")
.Range("B" & LastRow).Value = Format(Date + Time, "dd mmm yyyy hh:mm:ss")
End With
ActiveWorkbook.Save
Application.EnableEvents = True
End Sub
I have got a macro in an excel file which tracks the username and time of the users opening the file which I definitely need. The problem is that if 1 user opens the file and leaves it open then it doesn't track the name/time of other users who open the file when its in use. Is it anyway possible to track every user who opens the file even if the file is in use? I have copied the original code below. Many Thanks.
Option Explicit
Private LastRow As Long
Const HIDDEN_SHEET As String = "hidden"
Private Sub Workbook_Open()
Application.EnableEvents = False
With Worksheets(HIDDEN_SHEET)
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
.Range("A" & LastRow).Value = Environ("UserName")
.Range("B" & LastRow).Value = Format(Date + Time, "dd mmm yyyy hh:mm:ss")
End With
ActiveWorkbook.Save
Application.EnableEvents = True
End Sub