Jul 26 2021 04:13 AM
Hi
I need to get the currently logged in users email and manager. I have the username as per code below.
Sub GetLoggedInUserCredentials()
'Declare variables
Dim strUserName As String
Dim strPrincipal As String
Dim strUserEmail As String
'Get system logged in user name, manager and principal
strUserName = Environ("Username") 'This works
strPrincipal = Environ("Manager") '??? not sure what must go here, not sure Environ is the right thing looking to use Azure AD
strUserEmail = Environ("UserEmail") '???
Worksheets("Setup").Range("N17") = strUserName 'This works
Worksheets("Setup").Range("N20") = strPrincipal
Worksheets("Setup").Range("N21") = strUserEmail
End Sub
Jul 26 2021 07:56 AM
Email address and Manager aren't environment variables.
Jul 27 2021 02:36 AM
Jul 27 2021 03:36 AM
I'm afraid I cannot help you with this, sorry.