View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_876_] joel[_876_] is offline
external usenet poster
 
Posts: 1
Default IP address to Hostname in Excel


You can get the PC Name by usding the environmental variable
COMPUTERNAME


computerName = environ("COMPUTERNAME")


You can get the IP address from the computername by doing a ipconfig
command to the host name. From a sheel prompt

1) Start - run - c:\windos\system32\cmd.exe
2) ipconfig


You can run these commands from a sheel command like this

ComputerName = Environ("ComputerName")

Shell "cmd /c C:\windows\system32\ipconfig c:\temp\ipconfig.txt", 0


You can then open the text file to get the results.


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=194661

http://www.thecodecage.com/forumz