Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 163
Default Permissions to a macro

I have a button in excel, i want only certain users to be able to press it,
is they any way i can add permissions to the button?

Neil.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Permissions to a macro

Neil,

You could create a login userform and then use the username to determine
whether to enable or disable the command button. You could probably do the
same just using Windows username properties. I guess it depends on how large
your user base might be. I've used the login form method on several projects.

Ken

"Neil Holden" wrote:

I have a button in excel, i want only certain users to be able to press it,
is they any way i can add permissions to the button?

Neil.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Permissions to a macro

Neil,

You could do this but it's not secure. The variable S is a comma deleted
string of allowed users. If the active user isn't in the list then the sub
terminates

Sub Button1_Click()
S = "aaa,bbb,ccc"
v = Split(S, ",")
For x = 0 To UBound(v)
If Environ("username") = v(x) Then
allowed = True
Exit For
End If
Next
If Not allowed Then Exit Sub
MsgBox "OK"
'Your Code
End Sub

Mike

"Neil Holden" wrote:

I have a button in excel, i want only certain users to be able to press it,
is they any way i can add permissions to the button?

Neil.

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
Qualifying permissions in protect unprotect macro. Colin Hayes Excel Discussion (Misc queries) 4 April 26th 11 05:06 AM
How to Use Permissions Kev - Radio Man Excel Discussion (Misc queries) 0 May 16th 09 09:10 AM
folder permissions with a macro jatman Excel Discussion (Misc queries) 0 December 15th 08 10:07 PM
Permissions will07 Excel Discussion (Misc queries) 1 November 23rd 07 02:49 AM
Permissions Paul Excel Worksheet Functions 0 November 23rd 06 10:58 AM


All times are GMT +1. The time now is 07:26 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"