+ Reply to Thread
Results 1 to 9 of 9

Environ$ does not return the Username

  1. #1
    Registered User
    Join Date
    01-12-2018
    Location
    DRC
    MS-Off Ver
    2013
    Posts
    33

    Environ$ does not return the Username

    Hi,

    I have worksheet that everytime I save, it display on the specific Cell the username of the Last User who modified it.

    I used this code:
    Please Login or Register  to view this content.
    It was working fine with my computer and on one of my co worker, but suddenly it doesnt work on my Boss PC.
    it was working fine before, now it stopped displaying his name every time he save it.

    May I know what cause this? and some advise on the solution.

    Thanks in advanse

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,888

    Re: Environ$ does not return the Username

    Do you get any error messages?
    if not add a message box & see if that appears
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Environ$ does not return the Username

    Our corporate network seems to have different users with different setups for USERNAME (including some that are blank) there are other ways to get it.

    Try

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    If someone has helped you then please add to their Reputation

  4. #4
    Registered User
    Join Date
    01-12-2018
    Location
    DRC
    MS-Off Ver
    2013
    Posts
    33

    Re: Environ$ does not return the Username

    Thank you all,

    I think the Application.UserName works.
    I will check on my Boss PC shortly.

    regards

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,888

    Re: Environ$ does not return the Username

    FYI
    Application.Username returns the user name for Excel, not your windows login name.
    Therefore very easy for a user to change the name in xl to somebody else's name, by going to File > Options > general > Personalise your copy.

  6. #6
    Registered User
    Join Date
    01-12-2018
    Location
    DRC
    MS-Off Ver
    2013
    Posts
    33

    Re: Environ$ does not return the Username

    Hi all,,
    I checked my boss PC and its still not working..

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: Environ$ does not return the Username

    Does it give an error or just not work? Has he restarted Excel?
    Everyone who confuses correlation and causation ends up dead.

  8. #8
    Registered User
    Join Date
    01-12-2018
    Location
    DRC
    MS-Off Ver
    2013
    Posts
    33

    Re: Environ$ does not return the Username

    No error,
    I tried to add a message box and it appears.

  9. #9
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: Environ$ does not return the Username

    If you have access to his pc, open a command prompt (Windows key + r, then type cmd and press enter), type SET and press enter. Do you see Username listed with a value?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. HIde worksheets based on environ username
    By nayanthara in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-06-2015, 08:19 AM
  2. [SOLVED] Environ = Username
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-10-2014, 06:24 AM
  3. Parse first name & surname from Windows logon name (Environ("UserName")
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2013, 08:08 PM
  4. [SOLVED] Environ Username issue
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2013, 11:55 AM
  5. [SOLVED] Vlookup Environ ("username") to get proper name and allocate protection
    By nickmax1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-04-2012, 04:31 AM
  6. Difference between Environ("USERNAME") and Environ$("USERNAME")
    By ron2k_1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-04-2011, 11:15 AM
  7. Including Environ Username in Cell
    By swieduwi in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-30-2006, 11:43 AM

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