PDA

View Full Version : Solved: User name



ukdane
01-12-2009, 07:38 AM
In Excel 2003,
On the options box (under the Tools Menu), under General tab, there is a User Name field.

Is it possible to refer to the username, in VBA?

How do I assign it to a variable in VBA?


Dim myusername as string
myusername = 'the result in the optionsbox under the general tab

Cheers

georgiboy
01-12-2009, 07:42 AM
Application.Username

Bob Phillips
01-12-2009, 07:47 AM
I wouldn't use that, it is too simple to get changed by the user.

Use the login name



Environ("Username")

ukdane
01-12-2009, 07:50 AM
Ta!