View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Getting Logged in User Name in formula...

In other words, if it were you you would use my code <bg?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JLatham" <HelpFrom @ Jlathamsite.com.(removethis) wrote in message
...
If it were me, I'd use papau's code, just changing the one line that uses
the
Script object to use the Environ("username") [ GetUSerLogged =
Environ("username") ] form that Bob Phillips provided. Environ is going
to
work on any Excel setup, whereas there's a possibility of failure with the
script on some machines, plus scripting is external to Excel and is slower
to
return the result. papau's code slightly modified:

Function GetUSerLogged()
On Error Resume Next
GetUSerLogged = Environ("username")
If Err < 0 Then
GetUSerLogged = "Not available"
Err.Clear
End If
On Error GoTo 0
End Function


"Kedar Agarkar" wrote:

Thanks Pascal and Bob, shall be taking clues from your replies.
Thanks for your time.

- Kedar