#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default userName

Control Panel System = Registered to Ronald L. Lastname
In Excel, Tools Options General = User name: Ronald L. Lastname

Function USER()
USER = Application.UserName
= Ronald L. Lastname

End Function
Function USER2()
USER2 = Environ("UserName")
= Ron Lastname

End Function

Any help on what is going on would be appreciated.
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default userName

Hi Ronbo,

I believe that Environ("UserName") returns the Windows logon name which is
not necessarily the same as the Control Panel System = Registered to
"name." or the Excel name.

---
Regards,
Norman



"Ronbo" wrote in message
...
Control Panel System = Registered to Ronald L. Lastname
In Excel, Tools Options General = User name: Ronald L. Lastname

Function USER()
USER = Application.UserName
= Ronald L. Lastname

End Function
Function USER2()
USER2 = Environ("UserName")
= Ron Lastname

End Function

Any help on what is going on would be appreciated.
Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default userName

Sorry for being unclear. What you said is exactly what I have learned. When
I check the Windows logon name by:
Control Panel System; it = registered to Ronald L. Lastname

Yet when I use ;
Environ("UserName")
It returns - Ron Lastname

Why??

Thanks for your help.
Ronbo


"Norman Jones" wrote:

Hi Ronbo,

I believe that Environ("UserName") returns the Windows logon name which is
not necessarily the same as the Control Panel System = Registered to
"name." or the Excel name.

---
Regards,
Norman



"Ronbo" wrote in message
...
Control Panel System = Registered to Ronald L. Lastname
In Excel, Tools Options General = User name: Ronald L. Lastname

Function USER()
USER = Application.UserName
= Ronald L. Lastname

End Function
Function USER2()
USER2 = Environ("UserName")
= Ron Lastname

End Function

Any help on what is going on would be appreciated.
Thanks





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default userName

Control panel is telling you what name the person used that installed Windows.
On a multi-user system, that could very well be a different person than the
current user. Even if there's only one user, that person can set up his
Windows account using a different name that he used when installing Windows.


On Sat, 24 Sep 2005 19:43:03 -0700, "Ronbo"
wrote:

Sorry for being unclear. What you said is exactly what I have learned. When
I check the Windows logon name by:
Control Panel System; it = registered to Ronald L. Lastname

Yet when I use ;
Environ("UserName")
It returns - Ron Lastname

Why??

Thanks for your help.
Ronbo


"Norman Jones" wrote:

Hi Ronbo,

I believe that Environ("UserName") returns the Windows logon name which is
not necessarily the same as the Control Panel System = Registered to
"name." or the Excel name.

---
Regards,
Norman



"Ronbo" wrote in message
...
Control Panel System = Registered to Ronald L. Lastname
In Excel, Tools Options General = User name: Ronald L. Lastname

Function USER()
USER = Application.UserName
= Ronald L. Lastname

End Function
Function USER2()
USER2 = Environ("UserName")
= Ron Lastname

End Function

Any help on what is going on would be appreciated.
Thanks





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default userName

Its not a multi user system. So what is, Environ("UserName") really
returning, where does it find it and how can I check it?

"Myrna Larson" wrote:

Control panel is telling you what name the person used that installed Windows.
On a multi-user system, that could very well be a different person than the
current user. Even if there's only one user, that person can set up his
Windows account using a different name that he used when installing Windows.


On Sat, 24 Sep 2005 19:43:03 -0700, "Ronbo"
wrote:

Sorry for being unclear. What you said is exactly what I have learned. When
I check the Windows logon name by:
Control Panel System; it = registered to Ronald L. Lastname

Yet when I use ;
Environ("UserName")
It returns - Ron Lastname

Why??

Thanks for your help.
Ronbo


"Norman Jones" wrote:

Hi Ronbo,

I believe that Environ("UserName") returns the Windows logon name which is
not necessarily the same as the Control Panel System = Registered to
"name." or the Excel name.

---
Regards,
Norman



"Ronbo" wrote in message
...
Control Panel System = Registered to Ronald L. Lastname
In Excel, Tools Options General = User name: Ronald L. Lastname

Function USER()
USER = Application.UserName
= Ronald L. Lastname

End Function
Function USER2()
USER2 = Environ("UserName")
= Ron Lastname

End Function

Any help on what is going on would be appreciated.
Thanks








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default userName

You have already been told, Environ ("Username") returns the login name.
Only the system administrators control what is used here, the users do not,
whereas the value in Excel ToolsOptions can be changed by that user. The
Excel value was useful when the systems didn't login, like Win95, but is not
of much use nowadays that I can see.

--
HTH

Bob Phillips

"Ronbo" wrote in message
...
Its not a multi user system. So what is, Environ("UserName") really
returning, where does it find it and how can I check it?

"Myrna Larson" wrote:

Control panel is telling you what name the person used that installed

Windows.
On a multi-user system, that could very well be a different person than

the
current user. Even if there's only one user, that person can set up his
Windows account using a different name that he used when installing

Windows.


On Sat, 24 Sep 2005 19:43:03 -0700, "Ronbo"


wrote:

Sorry for being unclear. What you said is exactly what I have learned.

When
I check the Windows logon name by:
Control Panel System; it = registered to Ronald L. Lastname

Yet when I use ;
Environ("UserName")
It returns - Ron Lastname

Why??

Thanks for your help.
Ronbo


"Norman Jones" wrote:

Hi Ronbo,

I believe that Environ("UserName") returns the Windows logon name

which is
not necessarily the same as the Control Panel System = Registered

to
"name." or the Excel name.

---
Regards,
Norman



"Ronbo" wrote in message
...
Control Panel System = Registered to Ronald L. Lastname
In Excel, Tools Options General = User name: Ronald L. Lastname

Function USER()
USER = Application.UserName
= Ronald L. Lastname

End Function
Function USER2()
USER2 = Environ("UserName")
= Ron Lastname

End Function

Any help on what is going on would be appreciated.
Thanks








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default userName

I don't know what you are trying to accomplish, but I often use:
Application.UserName

This return the user name of the application (In this case, excel).

Sometimes I only want macros to trigger for certain users and this is how I
set it up. Of course, you have to have them go, in excel, to tools options
general to see how they have their username typed.


--
Thanks
Shawn


"Ronbo" wrote:

Control Panel System = Registered to Ronald L. Lastname
In Excel, Tools Options General = User name: Ronald L. Lastname

Function USER()
USER = Application.UserName
= Ronald L. Lastname

End Function
Function USER2()
USER2 = Environ("UserName")
= Ron Lastname

End Function

Any help on what is going on would be appreciated.
Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
(username v1) JJernigan Excel Discussion (Misc queries) 0 June 12th 08 09:13 PM
Username Log PaulJ Excel Discussion (Misc queries) 8 March 1st 06 11:51 AM
Username Alvin Hansen[_2_] Excel Programming 3 September 25th 04 10:36 PM
username libby Excel Programming 8 April 25th 04 03:37 AM
Get NT Username Steven Pugh Excel Programming 7 February 20th 04 09:37 AM


All times are GMT +1. The time now is 02:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"