Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub NomeDoUsuario()
Dim Nome As String
Dim Tamanho As Long
Nome = Space(255)
Tamanho = Len(Nome)
GetUserName Nome, Tamanho
MsgBox Trim(Nome)
End Sub