Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default 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
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
Need to Query Excel File Opened by Another User Paul Excel Discussion (Misc queries) 0 December 13th 06 05:57 PM
Excel file opened as read-only, if saved by another user GeEf Excel Discussion (Misc queries) 2 August 28th 05 04:29 PM
MS JET database engine error: workgroup information file is missing or opened exclusively by another user Tina Excel Discussion (Misc queries) 0 August 24th 05 01:40 AM
How to see if the opened workbook is opened by another user ? balexis Excel Programming 1 August 18th 04 04:11 PM
Recording the last saved date of an external file in a cell Mickey Mouse[_4_] Excel Programming 1 September 5th 03 09:29 AM


All times are GMT +1. The time now is 12:03 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"