ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   commandbar - rollout problem (https://www.excelbanter.com/excel-programming/314574-commandbar-rollout-problem.html)

tango

commandbar - rollout problem
 
Dear All, may i know if i need to create the customised toolbar and
button at user's excel before they can use? I have about 20 users
sharing this application and not all users allowed to use the
commandbar. only authorised user can use the commandbar. if i do not
create for those unauthorised user then they will face run time error
as button not at their excel.
pls help.
thanks alot



Private Sub Workbook_BeforeClose(Cancel As Boolean)
disable
End Sub

Sub disable()
Dim cmd As CommandBar
Set cmd = Application.CommandBars("Tender Bar")
cmd.controls("&kc").Enabled = False
End Sub


Private Sub CommandButton1_Click()
enable
End Sub

Sub enable()
Dim cmd As CommandBar
Set cmd = Application.CommandBars("Tender Bar")
cmd.controls("&kc").Enabled = True
End Sub

Frank Stone

commandbar - rollout problem
 
hi
have to tried using the Application.username to qualify
the ones who are authorized?
something like this in the open event
if application.username = "somebody" the
create toolbar
end if

regards
Frank

-----Original Message-----
Dear All, may i know if i need to create the customised

toolbar and
button at user's excel before they can use? I have about

20 users
sharing this application and not all users allowed to use

the
commandbar. only authorised user can use the commandbar.

if i do not
create for those unauthorised user then they will face

run time error
as button not at their excel.
pls help.
thanks alot



Private Sub Workbook_BeforeClose(Cancel As Boolean)
disable
End Sub

Sub disable()
Dim cmd As CommandBar
Set cmd = Application.CommandBars("Tender Bar")
cmd.controls("&kc").Enabled = False
End Sub


Private Sub CommandButton1_Click()
enable
End Sub

Sub enable()
Dim cmd As CommandBar
Set cmd = Application.CommandBars("Tender Bar")
cmd.controls("&kc").Enabled = True
End Sub
.



All times are GMT +1. The time now is 07:17 PM.

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