Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function to retrieve UserName in VBA?

Status
Not open for further replies.

brettatexplace

Technical User
Mar 8, 2002
60
0
0
CA
Easy question, but I can find it in the help files. I want to get the userID name retrieved from the network login. Is it something like???

Dim strUserIs as String
strUserIs = Environ("UserID")


Thanks in advance!
 
strUserIs = Environ("UserName")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
And for win9x:
strUserIs = CreateObject("WScript.Network").UserName

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top