+ Reply to Thread
Results 1 to 3 of 3

Get Actual Windows Username

  1. #1
    Registered User
    Join Date
    09-06-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    40

    Get Actual Windows Username

    Hi there,

    I'm trying to get the windows user name shown on the start menu via VBA which is proving to be troublesome. Pretty much every function I've found on the net finds the username which the account was created with, which doesn't change if the user changes the name for that account via the User Accounts console, all of these functions report that name and not the one on the start menu.

    Looked at all the potential solutions given here: http://bytes.com/topic/access/answer...ogged-username, http://www.vbforums.com/showthread.p...ndows-Username, http://www.vbaexpress.com/kb/getarticle.php?kb_id=768.

    Some of these range from simply using Environ to very complex API functions, but they never return what I need!

    Can anyone help me out? Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Get Actual Windows Username

    This command gives me the name I see on my Start Menu:
    Please Login or Register  to view this content.

    This one gives me the name of my computer:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    09-06-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    40

    Re: Get Actual Windows Username

    Hi there,

    Thanks for your reply. Does Environ still give you the name on the start menu if you change that name via the User Accounts Console? Environ will work for me until I change the name, after that it always returns what it first was.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1