Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Good morning,
I have a command button in a workbook to run a macro. However, when a user clicks on the button, the macro will check first automatically whether the user who clicks on it has an authority to run the macro. If not, the user will receive a message "Access denied.". So I came up with the following code: If Application.UserName < "John Doe" Then Msgbox "Access denied." Else run the remainder of code...... End If 2 questions: 1. What does the UserName Property check against with? Does it check against with Windows user name or computer user name? When I did the code "Msgbox Application.UserName", I got my first and last names. 2. I will have more than one authorized users, and instead of having the code "If Application.UserName < "John Doe" Or If Application.UserName < "John Smith" Or ......", can you help me with better coding? Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Get Property value of class instance by passing string property name | Excel Programming | |||
Runtime error 380 - Could not set the list property. Invalid property value. | Excel Programming | |||
Could not set the ControlSource property. Invalid property value error | Excel Programming | |||
Runtime Error 380 – Could not set the list property. Invalid property value | Excel Programming | |||
Runtime error 380: Could not set the List property. invalid property value of listbox | Excel Programming |