Run-time error '-2147352571 (80020005)'

Résolu/Fermé
Pedro - 3 oct. 2015 à 13:36
 Pedro - 5 oct. 2015 à 00:01
Bonjour,

J'ai un project Visual Basic pour un formulaire Excel. L'objectif c'est d'introduire les donnés sur ce formulaire avec 16 lignes, deployer automatiquement l'intitule client quand je saisis son cod et je presse "tab", et en suite, les envoyer dans un tableau excel.
Pour l'instant j'ai un erreur: '-2147352571 (80020005)'.
Est-ce que quelqu'un peu m'aider?
Merci

Module 1:

Sub Creation()
T_Creation.Show
End Sub

Function TriChamp(champ As Range)
Dim table()
table = champ
n = champ.Count ' tri shell
ecart = n
Do While ecart >= 1
ecart = ecart \ 2
inv = True
Do While inv
inv = False
For i = 1 To n - ecart
j = i + ecart
If table(i, 1) > table(j, 1) Then
temp = table(j, 1)
table(j, 1) = table(i, 1)
table(i, 1) = temp
inv = True
End If
Next
Loop
Loop
TriChamp = table
End Function

Module Classe:

Public WithEvents GRCODCLINTCreation As MSForms.TextBox
Private Sub GRCODCLINTCreation_change()

T_Creation.ChoixCODCLINT Mid(GRCODCLINTCreation.Name, 9) 'c'est la qu'apparait l'erreur

End Sub

Formulaire:

Dim TextCODCLINT(1 To 16) As New ClasseCLINTTournee
Private Sub UserForm_Initialize()
For b = 1 To 16: Set TextCODCLINT(b).GRCODCLINTCreation = Me("CODCLINT" & b): Next b
End Sub

Sub ChoixCODCLINT(no)
Me("INTCLINT" & no) = Application.VLookup(Me("CODCLINT" & no), Feuil1.Range("J2:M1562"), 2, False)

End Sub



1 réponse

f894009 Messages postés 17185 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 15 avril 2024 1 702
Modifié par f894009 le 4/10/2015 à 09:51
Bonjour,

un exemple en partant de votre code.
Modifs:
le numero de TextBox dans propriete Tag de chaque TextBox CODCLINTx a xx
Sub ChoixCODCLINT(no) 
dans un module
pour le reste vous verrez

https://www.cjoint.com/c/EJehYL1A04f
0
ça a marché! merci beaucoup...
0