d'erreur d’exaction 13 au niveau USERFORM

  • Initiateur de la discussion Initiateur de la discussion Ilino
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

Ilino

XLDnaute Barbatruc
Bonjour Forum
J’ai créé deux UserForm identique mais chacun est lié a une feuille
Lors d’exécution j'ai un message « d'erreur d’exaction 13 incompatibilité de type »
A ce niveau la (2eme UserForm)

Code:
Private Sub CommandButton6_Click()
pondération_avec.Show
End Sub
puis je avoir une explication ?
MERCI&GRAZIE
 
Re : d'erreur d’exaction 13 au niveau USERFORM

Re Bonjour Forum
Edit : Apres avoir F8 le pblm est de Private Sub UserForm_Initialize()
mon
Code:
Private Sub UserForm_Initialize()
'---- 
pondération_avec.TextBox8.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AL10").Value
pondération_avec.TextBox9.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AL14").Value
pondération_avec.TextBox10.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AL44").Value
pondération_avec.TextBox11.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AL50").Value
pondération_avec.TextBox12.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AL56").Value
pondération_avec.TextBox13.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AL64").Value

Me.TextBox8.Value = Format(Me.TextBox8.Value / 100, "00#.## %")
Me.TextBox9.Value = Format(Me.TextBox9.Value / 100, "00#.## %")
Me.TextBox10.Value = Format(Me.TextBox10.Value / 100, "00#.## %")
Me.TextBox11.Value = Format(Me.TextBox11.Value / 100, "00#.## %")
Me.TextBox12.Value = Format(Me.TextBox12.Value / 100, "00#.## %")
Me.TextBox13.Value = Format(Me.TextBox13.Value / 100, "00#.## %")

'---- Pondération Systeme
pondération_avec.TextBox20.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AO10").Value '* 100
pondération_avec.TextBox21.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AO14").Value '* 100 & Format(TextBox15, "00#.##%")
pondération_avec.TextBox22.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AO44").Value '* 100 & Format(variable, "# ##0.00")
pondération_avec.TextBox23.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AO50").Value '* 100 & Format(variable, "# ##0.00")
pondération_avec.TextBox24.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AO56").Value '* 100 & Format(variable, "# ##0.00")
pondération_avec.TextBox25.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AO64").Value '* 100 & Format(variable, "# ##0.00")

Me.TextBox20.Value = Format(Me.TextBox20.Value, "00#.## %")
Me.TextBox21.Value = Format(Me.TextBox21.Value, "00#.## %")
Me.TextBox22.Value = Format(Me.TextBox22.Value, "00#.## %")
Me.TextBox23.Value = Format(Me.TextBox23.Value, "00#.## %")
Me.TextBox24.Value = Format(Me.TextBox24.Value, "00#.## %")
Me.TextBox25.Value = Format(Me.TextBox25.Value, "00#.## %")

'---- Taux Réel
pondération_avec.TextBox14.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AM10").Value '* 100
pondération_avec.TextBox15.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AM14").Value '* 100 & Format(TextBox15, "00#.##%")
pondération_avec.TextBox16.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AM44").Value '* 100 & Format(variable, "# ##0.00")
pondération_avec.TextBox17.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AM50").Value '* 100 & Format(variable, "# ##0.00")
pondération_avec.TextBox18.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AM56").Value '* 100 & Format(variable, "# ##0.00")
pondération_avec.TextBox19.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AM64").Value '* 100 & Format(variable, "# ##0.00")

pondération_avec.TextBox32.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AM8").Value '* 100

Me.TextBox14.Value = Format(Me.TextBox14.Value, "00#.## %")
Me.TextBox15.Value = Format(Me.TextBox15.Value, "00#.## %")
Me.TextBox16.Value = Format(Me.TextBox16.Value, "00#.## %")
Me.TextBox17.Value = Format(Me.TextBox17.Value, "00#.## %")
Me.TextBox18.Value = Format(Me.TextBox18.Value, "00#.## %")
Me.TextBox19.Value = Format(Me.TextBox19.Value, "00#.## %")

Me.TextBox32.Value = Format(Me.TextBox32.Value, "00#.## %")


'---- Taux Final
pondération_avec.TextBox26.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AN10").Value '* 100
pondération_avec.TextBox27.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AN14").Value '* 100 & Format(TextBox15, "00#.##%")
pondération_avec.TextBox28.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AN44").Value '* 100 & Format(variable, "# ##0.00")
pondération_avec.TextBox29.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AN50").Value '* 100 & Format(variable, "# ##0.00")
pondération_avec.TextBox30.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AN56").Value '* 100 & Format(variable, "# ##0.00")
pondération_avec.TextBox31.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AN64").Value '* 100 & Format(variable, "# ##0.00")

pondération_avec.TextBox33.Value = Worksheets("LDF-Préstations (Avec PJ)").Range("AN8").Value '* 100 & Format(variable, "# ##0.00")

Me.TextBox26.Value = Format(Me.TextBox26.Value, "00#.## %")
Me.TextBox27.Value = Format(Me.TextBox27.Value, "00#.## %")
Me.TextBox28.Value = Format(Me.TextBox28.Value, "00#.## %")
Me.TextBox29.Value = Format(Me.TextBox29.Value, "00#.## %")
Me.TextBox30.Value = Format(Me.TextBox30.Value, "00#.## %")
Me.TextBox31.Value = Format(Me.TextBox31.Value, "00#.## %")

Me.TextBox33.Value = Format(Me.TextBox33.Value, "00#.## %")

'---- +/- Value
pondération_avec.Label12 = Worksheets("LDF-Préstations (Avec PJ)").Range("AJ10")
pondération_avec.Label13 = Worksheets("LDF-Préstations (Avec PJ)").Range("AJ14")
pondération_avec.Label14 = Worksheets("LDF-Préstations (Avec PJ)").Range("AJ44")
pondération_avec.Label15 = Worksheets("LDF-Préstations (Avec PJ)").Range("AJ50")
pondération_avec.Label16 = Worksheets("LDF-Préstations (Avec PJ)").Range("AJ56")
pondération_avec.Label17 = Worksheets("LDF-Préstations (Avec PJ)").Range("AJ64")

End Sub
???
MERCI
EDIT : et dans mon code ci dessus , il ya au qu'une variable ???
 
Dernière édition:
Re : d'erreur d’exaction 13 au niveau USERFORM

Bonjour,

Peut-être que TextBox? ou contient autre chose qu'un numérique alors que
Format(Me.TextBox?.Value / 100, "00#.## %") attend un nombre.

Question: Pourquoi de pas utiliser

Code:
With  Worksheets("LDF-Préstations (Avec PJ)")

TextBox8.Value = .Range("AL10").Value
'....
'.....

End With

pondération_avec. n'est pas obligatoire puisque c'est le parent par défaut.


Plutôt que ces répétitions, qui font perdre du temps et à la lecture et à vba pour évaluer chaque objet.parent à chaque ligne

a+
 
Re : d'erreur d’exaction 13 au niveau USERFORM

Bonsoir à tous


Il n'y a que moi que cela interpelle qu'Ilino ne joigne presque systématiquement jamais de fichier exemple
(sauf si on l'y invite) ?
(Ilino est pourtant xldien depuis 2012 ...🙄
 
Re : d'erreur d’exaction 13 au niveau USERFORM

Forum Bonsoir, Hasco, Reguiero et JM Bonsoir
Un grazie pour Tous
@ JM: juste pour vous informer que je n'ai pas joindre un fichier parce que j'ai vu que le code que j'ai mets est suffisant et pour d'autre raison de confidentialités merci encore une fois pour la remarque😱
A+
 
Re : d'erreur d’exaction 13 au niveau USERFORM

Re

Ilino:
Il suffit de joindre un fichier anonymisé!
Le code VBA n'étant pas lui confidentiel.

Pourquoi devrions perdre du temps à créer un classeur avec un userform, renommer les contrôles etc..
alors qu'il te suffit, toi de remplacer tes données originales par des données fictives...et de joindre ce fichier exemple ici ?

Ainsi nous aurions tous plus vite un fichier sur lequel faire nos tests !
(au lieu de chacun dans son coin créer un classeur, renommer une feuille en LDF-Préstations (Avec PJ), insérer un userform et y créer au moins 30 texbox ! ect ...
🙄
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

  • Question Question
Microsoft 365 affichage userform
Réponses
4
Affichages
364
Retour