Here are a couple of ways to get the names;
Declare Function WNetGetUser Lib "mpr.dll" Alias "WNetGetUserA" _
(ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long
Function GetName() As String
Dim strUserName As String
strUserName = Space(255)
WNetGetUser "", strUserName, 255
GetName = Trim(strUserName)
End Function
Private Declare Function GetComputerName Lib "kernel32" Alias _
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function ComputerName()
Dim strString As String
'Create a buffer 255 should be more then enougth
strString = String(255, Chr$(0))
'Get the computer name
GetComputerName strString, 255
'remove the unnecessary Null characters = chr$(0)'s
strString = Left$(strString, InStr(1, strString, Chr$(0)) - 1)
'Show the computer name
ComputerName = strString
End Function
HTH
Ivan