Thread: UserName
View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.programming
Brian K. Sheperd Brian K. Sheperd is offline
external usenet poster
 
Posts: 18
Default UserName

I dont know if this helps, but...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
MsgBox Application.UserName
Dim wsnet
Set wsnet = CreateObject("wscript.network")
MsgBox wsnet.UserName
Set wsnet = Nothing
End Sub

application.username = username listed in Excel
The other code will pull the network login name. You can save it to a
variable (i.e., varname = wsnet.username), and you could use the Now()
option to stamp the date and time. Then you could either record the
information on a worksheet or in a text file.

Brian



"Myriam" wrote in message
...
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.