Dim NameBuffer As String Dim PcName As String NameBuffer = Environment.MachineName NameBuffer = LSet(NameBuffer, 16) PcName = Strings.Left(NameBuffer, InStr(NameBuffer, vbNullChar) - 1)