Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Recording user and date of when a file is opened
Hi,
Is there a way to program VB to record the name of the user and date of when someone opens a file? I'm thinking the only way to do this would be to code to have a form open when someone opens the file that asks for their name and then have the code record the persons name and the date...wondering if there's an easier way. Thanks, Robert |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Recording user and date of when a file is opened
It is a whole pile easier than that. In the ThisWorkbook module there is an
event called Workbook_Open. This fires whenever the borkbook is opened. I recomend having a hidden sheet (possibly very hidden depending on what you want). Lets call it User Log. Your code will look something like this... Private Sub Workbook_Open() Dim rng As Range Set rng = Sheets("User Log").Range("A65536").End(xlUp).Offset(1, 0) rng.Value = Environ("UserName") rng.Offset(0, 1) = Now() End Sub -- HTH... Jim Thomlinson "Linking to specific cells in pivot table" wrote: Hi, Is there a way to program VB to record the name of the user and date of when someone opens a file? I'm thinking the only way to do this would be to code to have a form open when someone opens the file that asks for their name and then have the code record the persons name and the date...wondering if there's an easier way. Thanks, Robert |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Recording user and date of when a file is opened
Wow - this perfect -- and MUCH easier like you said. Thank you!!
"Jim Thomlinson" wrote: It is a whole pile easier than that. In the ThisWorkbook module there is an event called Workbook_Open. This fires whenever the borkbook is opened. I recomend having a hidden sheet (possibly very hidden depending on what you want). Lets call it User Log. Your code will look something like this... Private Sub Workbook_Open() Dim rng As Range Set rng = Sheets("User Log").Range("A65536").End(xlUp).Offset(1, 0) rng.Value = Environ("UserName") rng.Offset(0, 1) = Now() End Sub -- HTH... Jim Thomlinson "Linking to specific cells in pivot table" wrote: Hi, Is there a way to program VB to record the name of the user and date of when someone opens a file? I'm thinking the only way to do this would be to code to have a form open when someone opens the file that asks for their name and then have the code record the persons name and the date...wondering if there's an easier way. Thanks, Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need to Query Excel File Opened by Another User | Excel Discussion (Misc queries) | |||
Excel file opened as read-only, if saved by another user | Excel Discussion (Misc queries) | |||
MS JET database engine error: workgroup information file is missing or opened exclusively by another user | Excel Discussion (Misc queries) | |||
How to see if the opened workbook is opened by another user ? | Excel Programming | |||
Recording the last saved date of an external file in a cell | Excel Programming |