computer name retrieve (1 Viewer)

civ

New member
Local time
Today, 10:48
Joined
Sep 10, 2006
Messages
1
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

Dr. Data
Local time
Today, 00:48
Joined
Jun 5, 2006
Messages
442
Hello
Please see the enclosed example. This would be one way.
Regards
Mark
 

Attachments

  • Test.zip
    13.3 KB · Views: 1,495

ghudson

Registered User.
Local time
Today, 03:48
Joined
Jun 8, 2002
Messages
6,195
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

Super Moderator
Staff member
Local time
Today, 17:48
Joined
Jan 20, 2009
Messages
12,852
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.)
 

Users who are viewing this thread

Top Bottom