How do I get the current logged in Active Directory username from VBA?

后端 未结 4 1436
南旧
南旧 2021-01-22 05:38

I am new to Active Directory.

I have a VBA Excel Add-In that should run if, and only if, the computer that it is running on is currently logged into the Active Directory

4条回答
  •  终归单人心
    2021-01-22 06:10

    This function returns full name of logged user:

    Function UserNameOffice() As String
        UserNameOffice = Application.UserName
    End Function
    

提交回复
热议问题