General discussion

  • Creator
    Topic
  • #2296701

    VB API Call & Excel 2000

    Locked

    by sheryl v ·

    How 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 String

    strBuf = Space(255)
    lngLen = 255
    If CBool(DeclareGetLogin(strBuf, lngLen)) Then
    GetUserName = Left$(strBuf, lngLen – 1)
    Else
    GetUserName = “”
    End If

    End Function

All Comments

Viewing 1 reply thread