d'erreur d’exaction 13 au niveau USERFORM

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
 

Ilino

XLDnaute Barbatruc
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:
G

Guest

Guest
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+
 

Staple1600

XLDnaute Barbatruc
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 ...:rolleyes:
 

Ilino

XLDnaute Barbatruc
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:eek:
A+
 

Staple1600

XLDnaute Barbatruc
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 ...
:rolleyes:
 

Discussions similaires

Statistiques des forums

Discussions
312 299
Messages
2 086 991
Membres
103 422
dernier inscrit
victus5