ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to get system login name (https://www.excelbanter.com/excel-programming/334691-how-get-system-login-name.html)

39N 95W

How to get system login name
 
Windows XP Pro
Excel 2002 SP3

Is it possible to get the system login name (if it exists)? I want to do a
user check in the workbook open event so I can restrict some sheets from
certain edits, based on the user of course.

Any help appreciated.

-gk-


================================================== ======================
"The creative act is not the province of remote oracles or rarefied
geniuses but a transparent process that is open to everyone."
-Greg Kot in Wilco Learning How To Die-




Gixxer_J_97[_2_]

How to get system login name
 
are you looking for

Environ("UserName")

if Environ("UserName")="My User" then
' code here
end if

"39N 95W" wrote:

Windows XP Pro
Excel 2002 SP3

Is it possible to get the system login name (if it exists)? I want to do a
user check in the workbook open event so I can restrict some sheets from
certain edits, based on the user of course.

Any help appreciated.

-gk-


================================================== ======================
"The creative act is not the province of remote oracles or rarefied
geniuses but a transparent process that is open to everyone."
-Greg Kot in Wilco Learning How To Die-





Bob Phillips[_7_]

How to get system login name
 
Environ("UserName")

--
HTH

Bob Phillips

"39N 95W" wrote in message
...
Windows XP Pro
Excel 2002 SP3

Is it possible to get the system login name (if it exists)? I want to do

a
user check in the workbook open event so I can restrict some sheets from
certain edits, based on the user of course.

Any help appreciated.

-gk-


================================================== ======================
"The creative act is not the province of remote oracles or rarefied
geniuses but a transparent process that is open to everyone."
-Greg Kot in Wilco Learning How To Die-






gbor

How to get system login name
 
Here is how to access the newtork logon

msgbox( CreateObject("WScript.Network").UserName)



"39N 95W" wrote:

Windows XP Pro
Excel 2002 SP3

Is it possible to get the system login name (if it exists)? I want to do a
user check in the workbook open event so I can restrict some sheets from
certain edits, based on the user of course.

Any help appreciated.

-gk-


================================================== ======================
"The creative act is not the province of remote oracles or rarefied
geniuses but a transparent process that is open to everyone."
-Greg Kot in Wilco Learning How To Die-






All times are GMT +1. The time now is 08:49 PM.

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