Rolly_Sefu
Board Regular
- Joined
- Oct 25, 2013
- Messages
- 149
Hello I have a toggle button added to the ribbon (xml way)
and I have the following code:
I have created this button to add a functionality for a number of user that access the file.
The user that presses the button does not have the right to change, gets the error message.
But the button remains press. - this is the problem
And I can not figure out how to make the "State = False" work.
Help please.
and I have the following code:
Code:
Sub ribbonbutton1(control As IRibbonControl, ByRef cancelDefault)
If Sheets("Database").Range("I2") = "Yes" Then 'check if master
If Sheets("Database").Range("I4") <> "Yes" Then 'check if button is pressed
Sheets("Database").Range("I4") = "Yes" 'declare button is pressed Yes
Sheets("Board").Visible = True
Else
Sheets("Database").Range("I4") = "" 'reset pressed status to no
Sheets("Board").Visible = xlVeryHidden
End If
Else
MsgBox "You do not have the permission to make this change !", vbCritical, "STOP"
State = False ' => this does not work
End If
End Sub
I have created this button to add a functionality for a number of user that access the file.
The user that presses the button does not have the right to change, gets the error message.
But the button remains press. - this is the problem
And I can not figure out how to make the "State = False" work.
Help please.
Last edited: