Option Explicit
Public oRibbon As IRibbonUI
Public Mdp As String
Dim Voir_Masque As Boolean
Sub RibbonOnLoad(Ribbon As IRibbonUI)
Set oRibbon = Ribbon
End Sub
Sub Ribbon_OnAction_Press(control As IRibbonControl, pressed As Boolean)
UserForm1.Show
Mdp = UserForm1.TextBox1.Value
MsgBox Mdp
If Mdp = "motdepasse" Then
Voir_Masque = pressed
oRibbon.Invalidate
Exit Sub
Else
MsgBox Prompt:="Vous n'êtes pas autorisé à accéder à cette partie du logiciel.", _
Buttons:=48, Title:="Erreur"
End If
End Sub