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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Obtaining Computer Names in MS Excel 2

Status
Not open for further replies.

Porsche996GT2

Programmer
Oct 13, 2004
41
US
Hello,

I am trying to incorporate a security feature in one of our MS Excel tools at work which requires me to get the computer names of users. I know this is already available in MS Access, though I only found the Application.Username property in Excel. Is there a way to get the computer name/ network name of a user in Excel.

TIA!

Porsche 996 GT2
 
The Access VBA function detailed here: faq181-3779
will also work in Excel.

John
 
On WinNT,2k,XP the simplest way:
Environ("ComputerName")
Environ("UserName")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV, We're using 2K PRO here at work and that's even gonna work better for me.
 
For more info on environment variables:
faq707-4296

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
Porsche96GT2

Just hope you don't have an odd Win95/98/Me box sitting on the network still, the Environ variables won't work on those systems unless you manually set them.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top