Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Form_Load()
Dim strUserName As String
strUserName = String(100, Chr$(0))
GetUserName strUserName, 100
MsgBox (strUserName)
End Sub