A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi Bernie
C+/Dotnet can also use vba language (make a ref to that library), does not really help for my understanding....
Thank you
JY
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello
I used previously this API function
Declare Function wu_GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function GetUserName() As Variant
Dim strUserName As String, lngLength As Long, lngResult As Long
strUserName = String$(255, 0)
lngLength = 255
lngResult = wu_GetUserName(strUserName, lngLength)
GetUserName = Left(strUserName, InStr(1, strUserName, Chr(0)) - 1)
End Function
Similarly, you could use : Environ("username")
Both function return the same string that needs to be the current user/window session logged on that pc.
Any comment ?
Regards
JY
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Hi Bernie
C+/Dotnet can also use vba language (make a ref to that library), does not really help for my understanding....
Thank you
JY