Getting computer name using VBA


Is there a way to get the name of the computer in VBA?


Answers:


Dim sHostName As String

' Get Host Name / Get Computer Name

sHostName = Environ$("computername")