Logging who has opened excel document

cpatten

New Member
Joined
Jul 2, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Good evening,

I have a excel file that is shared with staff in my business and I need to log who is opening the file. I don't need to know what they do just who has opened it and when.

Is this doable?

Thanks,

Chris
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
for sure. Create a new sheet...it can be hidden if you choose. Then add something like this to the 'ThisWorkbook' module:

In this example, my new sheet was Sheet5.

VBA Code:
Private Sub Workbook_Open()
Dim lrow As Long
lrow = Sheet5.Cells.Find("*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row + 1
    Sheet5.Range("A" & x).Value = Now()
    Sheet5.Range("B" & x).Value = Environ("Username")
End Sub
 
Upvote 0
for sure. Create a new sheet...it can be hidden if you choose. Then add something like this to the 'ThisWorkbook' module:

In this example, my new sheet was Sheet5.

VBA Code:
Private Sub Workbook_Open()
Dim lrow As Long
lrow = Sheet5.Cells.Find("*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row + 1
    Sheet5.Range("A" & x).Value = Now()
    Sheet5.Range("B" & x).Value = Environ("Username")
End Sub
Hi Joe,

Thank you for this. I have copied this across but keep getting a runtime error '1004'
 
Upvote 0
did you change 'Sheet5' to whatever your sheet number is?


1719954996000.png
 
Upvote 0
Sorry...typo on my part. Try this:

VBA Code:
Private Sub Workbook_Open()
Dim lrow As Long
lrow = Sheet6.Cells.Find("*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row + 1
    Sheet6.Range("A" & lrow).Value = Now()
    Sheet6.Range("B" & lrow).Value = Environ("Username")
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,164
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top