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

Trying To Get Computer Name in Excel VBA 1

Status
Not open for further replies.

PBAPaul

Programmer
Aug 3, 2002
140
GB
I have just upgraded my systems from Office 2003 to Office 2010.

In a VBA project that was created in Office 2003, I need to copy a sheet from a file to each of the other computers on my network.
I use the 2003 VBA code of "NameOfComputer" I use this to find the name of the initiating computer and then I am able to stipulate a copy path for each of the computers on the network.

When I run it in Office 2010 I get a blank string. It is such a long time since I wrote that code that I am not sure whether that was included in an Add-in or what. Can anyone help me please to get the name of the computer that is running the VBA code?

 
What about this ?
Environ("ComputerName")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top