ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Win XP Logon Name (https://www.excelbanter.com/excel-programming/341543-win-xp-logon-name.html)

Andy Ives[_2_]

Win XP Logon Name
 
Ayone know how to reference a Win XP network user name from VBA?
Any pointers to required references etc gratefully received!

Cheers

Andy

Norman Jones

Win XP Logon Name
 
Hi Andy.

Try:

LName = Environ("UserName")


---
Regards,
Norman



"Andy Ives" wrote in message
...
Ayone know how to reference a Win XP network user name from VBA?
Any pointers to required references etc gratefully received!

Cheers

Andy




Andy Ives[_2_]

Win XP Logon Name
 
Thanks norman - works a treat.
I've just found Application.Username in the Excel Object Model and that
seems to work too

Cheers

Andy

"Norman Jones" wrote:

Hi Andy.

Try:

LName = Environ("UserName")


---
Regards,
Norman



"Andy Ives" wrote in message
...
Ayone know how to reference a Win XP network user name from VBA?
Any pointers to required references etc gratefully received!

Cheers

Andy





Norman Jones

Win XP Logon Name
 
Hi Andy,

I've just found Application.Username in the Excel Object Model and that
seems to work too


That returns the name inserted in:

Tools | Options | General | User Name.

This is the Excel user name and can freely be changed.

Environ("UserName") returns the Windows logon name.

---
Regards,
Norman



"Andy Ives" wrote in message
...
Thanks norman - works a treat.
I've just found Application.Username in the Excel Object Model and that
seems to work too

Cheers

Andy

"Norman Jones" wrote:

Hi Andy.

Try:

LName = Environ("UserName")


---
Regards,
Norman



"Andy Ives" wrote in message
...
Ayone know how to reference a Win XP network user name from VBA?
Any pointers to required references etc gratefully received!

Cheers

Andy








All times are GMT +1. The time now is 01:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com