Thread: UserName
View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
quartz[_2_] quartz[_2_] is offline
external usenet poster
 
Posts: 441
Default UserName

You already have a load of info here, but I just thought I'd throw in
something I use. I added a "Before_Save" event to my files and have it write
the following to a "very hidden" sheet in the file (you could also code this
to update a remote text file for user history) [NOTE: ReturnComputerName also
returns the computer name that the user was on when they saved the file]:

Public Function ReturnUserName() As String
'RETURN THE USER NAME AS RECORDED IN [TOOLS][OPTIONS][GENERAL]
ReturnUserName = Application.UserName
End Function

OR:

Public Function ReturnNetworkName() As String
'RETURNS NETWORK LOGIN ID OF CURRENT USER
ReturnNetworkName = Environ("UserName")
End Function

AND:

Public Function ReturnComputerName() As String
'RETURNS COMPUTER NUMBER USER IS ON
ReturnComputerName = Environ("ComputerName")
End Function

HTH

"Myriam" wrote:

How can I "capture" the the name of the last user that saved a wkbk? Is there
something like capturing date/time BuiltinDocumentProperties ("Last Save
Time") for user name?
Thanks. I'm really greatful for any light you can give me.