View Full Version : computer name retrieve


civ
09-10-2006, 12:03 AM
Hello,

I need to retrieve the computer name from running application. I didn't find any function for that (for VBA 2000). Can anybody help me?

Thanks.

mhartman
09-10-2006, 06:32 AM
Hello
Please see the enclosed example. This would be one way.
Regards
Mark

ghudson
09-11-2006, 11:37 AM
Yuck! All that code just to retrieve something so simple.

The Environ() function will that and much more.

MsgBox "Network Name = " & Environ("username")
MsgBox "Computer Name = " & Environ("computername")

Search the forum for the keyword ENVIRON and my user name for I have a sample db posted somewhere that will list all of the Environ variables.

Galaxiom
09-22-2010, 10:28 PM
Yuck! All that code just to retrieve something so simple.

The Environ() function will that and much more.

Except that the Environment variables can be modified by the user.

Don't rely on using environment variables if you really care about the results.

(An old thread yes but it is important to warn about the vulnerablity.)