Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

Is there a way to gather the user name information if I am in excel?

Is there a way to gather the user name information if I am in excel?  I need to confirm that the user launching the activity is the correct person.
0
ilrosebud26
Asked:
ilrosebud26
  • 3
  • 3
  • 2
  • +1
1 Solution
 
kaosyetiCommented:
why not just password protect the spreadsheet?
0
 
patrickabCommented:
Place this in an ordinary module:

Function DocProps(DocDetail)
    DocProps = ThisWorkbook.BuiltinDocumentProperties(DocDetail)  
End Function

Use it like this:

=DocProps(3) to get the user name. However it assumes the user profile is correctly completed in Tools/Options/General/UserName
0
 
Rory ArchibaldCommented:
You can use Application.UserName to get the name entered in the Tools->Options dialog, or Environ("username") to get the login name.
HTH
Rory
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
patrickabCommented:
Rory,

I always have trouble with ENVIRON(). What has to be installed for it to work?

Patrick
0
 
ilrosebud26Author Commented:
Maybe I should tell you what I am tring to do.  I have an approval button on a spreadsheet and I need to ensure that the person clicking the button is a certain person.  The spreadsheet is password protected.  I thought that if I compare the user name to a table it would be the best way to ensure that the correct person is completing the task.
0
 
ilrosebud26Author Commented:
I guess I need to get the network name/ID from the domain they are attached to.  I don't think the application is user name is what I need.  What do you think?

0
 
Rory ArchibaldCommented:
Patrick,
To the best of my knowledge all you need is an NT-based system.

ilrosebud26,
Use Environ("username") if you need the login ID.

Regards,
Rory
0
 
patrickabCommented:
Rory - Thanks for that. My error all along - just didn't understand where, how or when to use it. All clear now. - Patrick
0
 
ilrosebud26Author Commented:
Thanks-
   I will try this and see what happens.

Rosemary
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now