Macro security via Windows login name (or other)

  • Thread starter Thread starter Neil
  • Start date Start date
N

Neil

Hi All,

Is there a way that I can limit access to a macro via the windows login name
?

For example, something along the lines of 'if windows login user name = Neil
then continue executing macro, else flash an error message and stop.

Any ideas ?

Thanks everyone.

Neil
 
Sub a()
If Environ("username") = "Neil" Then
MsgBox "OK"
Else
MsgBox "Not OK"
End If
End Sub


--
Jim
| Hi All,
|
| Is there a way that I can limit access to a macro via the windows login
name
| ?
|
| For example, something along the lines of 'if windows login user name =
Neil
| then continue executing macro, else flash an error message and stop.
|
| Any ideas ?
|
| Thanks everyone.
|
| Neil
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top