Obtener nombre del usuario
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function UserName() As String
Dim strUsername As String
'Create a buffer
'***************
strUsername = String(255, Chr$(0))
'Get the username
'****************
GetUserName strUsername, 255
'Strip the rest of the buffer
'****************************
UserName = Left$(strUsername, InStr(strUsername, Chr$(0)) - 1)
End Function
Saludos