constante password problème
Bonjour,
Bonjour,
J'ai ce bout de code qui coince au niveau de la ligne PW.
Afin de ne pas encode à chaque SUB le password, j'aurais voulu le mettre en constante et donc dans un module j'ai tapé CONST PW = "1234".
Mais cela bloque quand même. PQ?
Merci pour votre aide.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Private Sub CBAdmin_Click()
Dim ws As Worksheet
If TBPW.Value = PW Then
ThisWorkbook.Unprotect Password:=PW
For Each ws In ThisWorkbook.Worksheets
ws.Visible = True
Next ws
Unload frm_Admin
Else
TBPW.Value = "Insert Password..."
End If
End Sub |