Excel et mot de passe
Résolu
emi
-
emi -
emi -
Bonjour tout le monde,
J' ai lié un bouton de commande à un mot de passe, il fonctionne mais si on rentre un mauvais mot de passe ou si on clique sur annuler, excel se ferme. Je voudrais savoir comment affiche un message "mot de passe faux, resississez le " quand celui-ci est faux.
Une autre question, comment faire pour cacher le mot de passe quand on le saisi?
Merci de votre aide.
J' ai lié un bouton de commande à un mot de passe, il fonctionne mais si on rentre un mauvais mot de passe ou si on clique sur annuler, excel se ferme. Je voudrais savoir comment affiche un message "mot de passe faux, resississez le " quand celui-ci est faux.
Une autre question, comment faire pour cacher le mot de passe quand on le saisi?
Merci de votre aide.
A voir également:
- Excel et mot de passe
- Trousseau mot de passe iphone - Guide
- Mot de passe - Guide
- Mot de passe administrateur - Guide
- Identifiant et mot de passe - Guide
- Mot de passe bios perdu - Guide
4 réponses
Voici le code pour mon mot de passe:
Private Sub CommandButton9_Click()
Dim CmdB As CommandBar
reponse = InputBox("Bonjour,Entrez votre mot de passe", "Accés réservé")
If reponse = "mpd" Then
For Each CmdB In Application.CommandBars
CmdB.Enabled = False
Next CmdB
Application.CommandBars(3).Enabled = True
Application.DisplayStatusBar = False
ActiveWindow.DisplayWorkbookTabs = False
'With Application
'.ShowStartupDialog = False
'.ShowWindowsInTaskbar = False
'End With
Sheets("Tools").Select
Menu.Hide
Else
Application.Quit
End If
End Sub
Private Sub CommandButton9_Click()
Dim CmdB As CommandBar
reponse = InputBox("Bonjour,Entrez votre mot de passe", "Accés réservé")
If reponse = "mpd" Then
For Each CmdB In Application.CommandBars
CmdB.Enabled = False
Next CmdB
Application.CommandBars(3).Enabled = True
Application.DisplayStatusBar = False
ActiveWindow.DisplayWorkbookTabs = False
'With Application
'.ShowStartupDialog = False
'.ShowWindowsInTaskbar = False
'End With
Sheets("Tools").Select
Menu.Hide
Else
Application.Quit
End If
End Sub
Bonjour,
Voici le code. En fait il suffit de changer cette ligne : (après Else) Application.Quit et de rmplacer par une msgbox :
Private Sub CommandButton9_Click()
Dim CmdB As CommandBar
reponse = InputBox("Bonjour,Entrez votre mot de passe", "Accés réservé")
If reponse = "mpd" Then
For Each CmdB In Application.CommandBars
CmdB.Enabled = False
Next CmdB
Application.CommandBars(3).Enabled = True
Application.DisplayStatusBar = False
ActiveWindow.DisplayWorkbookTabs = False
'With Application
'.ShowStartupDialog = False
'.ShowWindowsInTaskbar = False
'End With
Sheets("Tools").Select
Menu.Hide
Else
MsgBox("mot de passe faux, ressaisissez le")
End If
End Sub
Pour cacher le mot de passe, il faudrait passer par un UserForm.
Voici le code. En fait il suffit de changer cette ligne : (après Else) Application.Quit et de rmplacer par une msgbox :
Private Sub CommandButton9_Click()
Dim CmdB As CommandBar
reponse = InputBox("Bonjour,Entrez votre mot de passe", "Accés réservé")
If reponse = "mpd" Then
For Each CmdB In Application.CommandBars
CmdB.Enabled = False
Next CmdB
Application.CommandBars(3).Enabled = True
Application.DisplayStatusBar = False
ActiveWindow.DisplayWorkbookTabs = False
'With Application
'.ShowStartupDialog = False
'.ShowWindowsInTaskbar = False
'End With
Sheets("Tools").Select
Menu.Hide
Else
MsgBox("mot de passe faux, ressaisissez le")
End If
End Sub
Pour cacher le mot de passe, il faudrait passer par un UserForm.