variable non defini?!!

greg954

XLDnaute Junior
Bonjour à tous , j'ai un message d'erreur "variable non defini" comprend pas! pourquoi? j'aimerai comprendre si il y avait un eame charitable.
Merfi de votre aide.
Greg
voici le code:

Option Explicit
Private Declare Function GetWindowLongA Lib "User32" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long

Private Declare Function SetWindowLongA Lib "User32" _
(ByVal hWnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function FindWindowA Lib "User32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub UserForm_Initialize()
Dim hWnd As Long
Dim Feuille As String
hWnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", _
"X", "D") & "Frame", Me.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) And &HFFF7FFFF

End Sub
Private Sub CommandButton1_Click()
Reponse = InputBox("Mot de passe?")
If Reponse <> "247yz" Then MsgBox ("Mot de passe erroné"): Exit Sub
Call x
End Sub
Private Sub x_Click()
UserForm.Hide
End Sub
l'erreur se produit dans la commande " reponse"

J'ai joint un fichier "exemple"
Merci encore
 

Pièces jointes

  • essai userform sans croix.xls
    54.5 KB · Affichages: 36

greg954

XLDnaute Junior
Re : variable non defini?!!

Merci mj13
voici le code qui fonctionne si ça interesse quelqu'un
Dim maVariable As String

maVariable = InputBox("Mot de passe?")

If maVariable <> "247yz" Then MsgBox ("Mot de passe erroné"): Exit Sub
UserForm1.Hide
 

Discussions similaires

Statistiques des forums

Discussions
312 379
Messages
2 087 761
Membres
103 661
dernier inscrit
fcleves