Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Excel user's name 13

Status
Not open for further replies.

pho01

Programmer
Mar 17, 2003
218
US
How do I get the username's of the Excel application using VBA?

To be more clear, that's the username when one brings up Excel application, "this product is licensed to ...(username)".

Thanks,
 
environment variables are not fixed, and can easily be changed by the user.
 
strongm - if you don't mind.....could you provide further info...how exactly could a user change the environ("username") for example ???

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Here's one way

My Computer/Properties/Advanced/Environment Variables

Then click New if username isn't listed (it's a built-in variable, but can be overridden)

Type "Username" against variable name
Type "whateveryoulike" against "Variable Value"

OK/OK/OK
 
Thanks Strongm - given the computer literacy of most of the users here.....and the fact that most machines are locked down, I'll take my chances with the environment variables. Would this cause a similar problem with the api call as supplied by Chattin ??

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
What OS are you using, strongm? I don't have the "Advanced" tab in Properties. . .


VBAjedi [swords]
 
xlbo,
No, it doesn't effect the API solution

VBAjedi,
NT-based have it: Nt4, W2K, XP, 2003

In W95/98/Me it's easier: start a commandline and type: set username=whateveryoulike

 
Sorry I didn't finish....

Placing all the "sets" in one place makes them easier to deal with later
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top