General discussion
-
Topic
-
VB API Call & Excel 2000
LockedHow can I make this API call & function that DOES work in MSAccess 2000 on Win2000 work in Excel2000, same platform?
Declare Function DeclareGetLogin Lib “advapi32.dll” Alias “GetUserNameA” (ByVal lpBuffer As String, nSize As Long) As Long
Function GetUserName() As String
Dim lngLen As Long
Dim strBuf As StringstrBuf = Space(255)
lngLen = 255
If CBool(DeclareGetLogin(strBuf, lngLen)) Then
GetUserName = Left$(strBuf, lngLen – 1)
Else
GetUserName = “”
End IfEnd Function