Private Declare Function GetUserNameA Lib "advapi32.dll" (ByVal lpBuffer As String, nSize As Long) As Long
Public Function GetUserName() As String
Dim temp As String
Dim slength As Long
temp = Space(255)
slength = 255
GetUserNameA temp, slength
GetUserName = Left(temp, slength - 1)
End Function