How do I refresh Environ(Username) on workbook open (Excel 2010)?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scrapcode
    New Member
    • Apr 2010
    • 26

    How do I refresh Environ(Username) on workbook open (Excel 2010)?

    Hi everyone.

    I'm facing a problem with excel 2010 when using a function that worked fine in 2003.

    I'm using Environ(usernam e) in the following function in module 1:

    Code:
    Public Function Username()
    Username = Environ("UserName")
    End Function
    In my workbook I have a cell in which is =username().
    This brings back my log in id fine. The problem comes when other users open the form. It's not refreshing with other users id's.

    I've opened the file on someone else's machine to test and it's my log on that shows. If I recaculate the book nothing happens and if I remove the "=Username( )" from the cell and retype it I get a complile error in module 1.

    I've scoured the internet to no avail. There was mention of the function not being volatile, and to fix that I needed to add the "application.vo latile" to the first line of the function, but that didn't help.

    I have to say, since moving from 2003 to 2010, I've had more problems than not.

    Any help you guys can provide is appreiciated.
Working...