network name

J

Jay Freedman

Jay Freedman said:
Try this statement:

Environ("ComputerName")

Erm... of course, that isn't a statement, it's an expression that
returns a string. You can assign it to a string variable

Dim MyComputer As String
MyComputer = Environ("ComputerName")

or you can display it

MsgBox Environ("ComputerName")
 
T

ted medin

Erm... of course, that isn't a statement, it's an expression that
returns a string. You can assign it to a string variable

Dim MyComputer As String
MyComputer = Environ("ComputerName")

or you can display it

MsgBox Environ("ComputerName")

One further problem: xp os gave me the correct name BUT me os gave me ""
Anyone got any ideas? TIA
 
T

ted medin

How do i find out the name of the pc from within a vba pgm? TIA
Erm... of course, that isn't a statement, it's an expression that
returns a string. You can assign it to a string variable

Dim MyComputer As String
MyComputer = Environ("ComputerName")

or you can display it

MsgBox Environ("ComputerName")

Works fine in xp but NOT me. I get "" from me & win98. HELP! TIA.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top