Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Modules de classe

3 réponses
Avatar
Jean-Paul V
Bonjour à tous

J’ai un module de classe qui initialise un Userform qui permet de changer
les couleurs d’un graphique.

Ce Userform fonctionne pour changer la couleur du libellé de l’axe des X
nous avons dans le module de classe :

Case 5 ' libellé axe des X
If Range("RésultatTypeBorder").Value = "II" Then ‘ici ça marche
'Ne rien faire
ElseIf Range("RésultatTypeBorder").Value = "BS" Then ' l'axe des x devient
Font
‘l’instruction qui suit se plante ! ! !
With .ChartObjects("graphe").ChartGroups(1).RadarAxisLabels
.AutoScaleFont = True
.Font.ColorIndex = iColor
End With
Else ‘Ici ça marche
With .ChartObjects("graphe").Chart.Axes(xlCategory)
.TickLabels.Font.FontStyle = "Gras"
.TickLabels.Font.Background = xlTransparent
.TickLabels.Font.ColorIndex = iColor
End With
End If

Lorsque notre graphique est un Radar nous n’avons pas un axe des X mais un
Font

Sachant que la Macro suivante dans un module fonctionne dans le cas d’un
Radar :

Sub essai()
ActiveSheet.ChartObjects("graphe").Activate
ActiveChart.ChartGroups(1).RadarAxisLabels.Select
Selection.AutoScaleFont = True
With Selection.Font
.ColorIndex = 2
End With
ActiveWindow.Visible = False
Range("M29").Select
End Sub

Pourquoi je me fais jeter avec erreur exécution ‘’438 ‘’sur l’instruction ‘’
With .ChartObjects("graphe").ChartGroups(1).RadarAxisLabels ‘’ si je mets
dans mon module de classe :

ElseIf Range("RésultatTypeBorder").Value = "BS" Then ' l'axe des x devient
Font
With .ChartObjects("graphe").ChartGroups(1).RadarAxisLabels
.AutoScaleFont = True
.Font.ColorIndex = iColor
End With

Comment corriger mon module de classe ?

@+ j’espère

3 réponses

Avatar
Daniel
Bonjour.
Teste :

With ActiveSheet
With .ChartObjects("Graphe").Chart.ChartGroups(1).RadarAxisLabels
.AutoScaleFont = True
.Font.ColorIndex = iColor
End With
End With

Cordialement.
Daniel
"Jean-Paul V" a écrit dans le message
de news:
Bonjour à tous

J'ai un module de classe qui initialise un Userform qui permet de changer
les couleurs d'un graphique.

Ce Userform fonctionne pour changer la couleur du libellé de l'axe des X
nous avons dans le module de classe :

Case 5 ' libellé axe des X
If Range("RésultatTypeBorder").Value = "II" Then 'ici ça marche
'Ne rien faire
ElseIf Range("RésultatTypeBorder").Value = "BS" Then ' l'axe des x devient
Font
'l'instruction qui suit se plante ! ! !
With .ChartObjects("graphe").ChartGroups(1).RadarAxisLabels
.AutoScaleFont = True
.Font.ColorIndex = iColor
End With
Else 'Ici ça marche
With .ChartObjects("graphe").Chart.Axes(xlCategory)
.TickLabels.Font.FontStyle = "Gras"
.TickLabels.Font.Background = xlTransparent
.TickLabels.Font.ColorIndex = iColor
End With
End If

Lorsque notre graphique est un Radar nous n'avons pas un axe des X mais un
Font

Sachant que la Macro suivante dans un module fonctionne dans le cas d'un
Radar :

Sub essai()
ActiveSheet.ChartObjects("graphe").Activate
ActiveChart.ChartGroups(1).RadarAxisLabels.Select
Selection.AutoScaleFont = True
With Selection.Font
.ColorIndex = 2
End With
ActiveWindow.Visible = False
Range("M29").Select
End Sub

Pourquoi je me fais jeter avec erreur exécution ''438 ''sur l'instruction
''
With .ChartObjects("graphe").ChartGroups(1).RadarAxisLabels '' si je mets
dans mon module de classe :

ElseIf Range("RésultatTypeBorder").Value = "BS" Then ' l'axe des x devient
Font
With .ChartObjects("graphe").ChartGroups(1).RadarAxisLabels
.AutoScaleFont = True
.Font.ColorIndex = iColor
End With

Comment corriger mon module de classe ?

@+ j'espère




Avatar
Jean-Paul V
Bonjour Daniel

ça marche pas !

@+


Bonjour.
Teste :

With ActiveSheet
With .ChartObjects("Graphe").Chart.ChartGroups(1).RadarAxisLabels
.AutoScaleFont = True
.Font.ColorIndex = iColor
End With
End With

Cordialement.
Daniel
"Jean-Paul V" a écrit dans le message
de news:
Bonjour à tous

J'ai un module de classe qui initialise un Userform qui permet de changer
les couleurs d'un graphique.

Ce Userform fonctionne pour changer la couleur du libellé de l'axe des X
nous avons dans le module de classe :

Case 5 ' libellé axe des X
If Range("RésultatTypeBorder").Value = "II" Then 'ici ça marche
'Ne rien faire
ElseIf Range("RésultatTypeBorder").Value = "BS" Then ' l'axe des x devient
Font
'l'instruction qui suit se plante ! ! !
With .ChartObjects("graphe").ChartGroups(1).RadarAxisLabels
.AutoScaleFont = True
.Font.ColorIndex = iColor
End With
Else 'Ici ça marche
With .ChartObjects("graphe").Chart.Axes(xlCategory)
.TickLabels.Font.FontStyle = "Gras"
.TickLabels.Font.Background = xlTransparent
.TickLabels.Font.ColorIndex = iColor
End With
End If

Lorsque notre graphique est un Radar nous n'avons pas un axe des X mais un
Font

Sachant que la Macro suivante dans un module fonctionne dans le cas d'un
Radar :

Sub essai()
ActiveSheet.ChartObjects("graphe").Activate
ActiveChart.ChartGroups(1).RadarAxisLabels.Select
Selection.AutoScaleFont = True
With Selection.Font
.ColorIndex = 2
End With
ActiveWindow.Visible = False
Range("M29").Select
End Sub

Pourquoi je me fais jeter avec erreur exécution ''438 ''sur l'instruction
''
With .ChartObjects("graphe").ChartGroups(1).RadarAxisLabels '' si je mets
dans mon module de classe :

ElseIf Range("RésultatTypeBorder").Value = "BS" Then ' l'axe des x devient
Font
With .ChartObjects("graphe").ChartGroups(1).RadarAxisLabels
.AutoScaleFont = True
.Font.ColorIndex = iColor
End With

Comment corriger mon module de classe ?

@+ j'espère









Avatar
Daniel
Euh, j'ai mis "Graphe" avec une majuscule, est-ce que tu as rectifié ?
Daniel
"Jean-Paul V" a écrit dans le message
de news:
Bonjour Daniel

ça marche pas !

@+


Bonjour.
Teste :

With ActiveSheet
With .ChartObjects("Graphe").Chart.ChartGroups(1).RadarAxisLabels
.AutoScaleFont = True
.Font.ColorIndex = iColor
End With
End With

Cordialement.
Daniel
"Jean-Paul V" a écrit dans le
message
de news:
Bonjour à tous

J'ai un module de classe qui initialise un Userform qui permet de
changer
les couleurs d'un graphique.

Ce Userform fonctionne pour changer la couleur du libellé de l'axe des
X
nous avons dans le module de classe :

Case 5 ' libellé axe des X
If Range("RésultatTypeBorder").Value = "II" Then 'ici ça marche
'Ne rien faire
ElseIf Range("RésultatTypeBorder").Value = "BS" Then ' l'axe des x
devient
Font
'l'instruction qui suit se plante ! ! !
With .ChartObjects("graphe").ChartGroups(1).RadarAxisLabels
.AutoScaleFont = True
.Font.ColorIndex = iColor
End With
Else 'Ici ça marche
With .ChartObjects("graphe").Chart.Axes(xlCategory)
.TickLabels.Font.FontStyle = "Gras"
.TickLabels.Font.Background = xlTransparent
.TickLabels.Font.ColorIndex = iColor
End With
End If

Lorsque notre graphique est un Radar nous n'avons pas un axe des X mais
un
Font

Sachant que la Macro suivante dans un module fonctionne dans le cas
d'un
Radar :

Sub essai()
ActiveSheet.ChartObjects("graphe").Activate
ActiveChart.ChartGroups(1).RadarAxisLabels.Select
Selection.AutoScaleFont = True
With Selection.Font
.ColorIndex = 2
End With
ActiveWindow.Visible = False
Range("M29").Select
End Sub

Pourquoi je me fais jeter avec erreur exécution ''438 ''sur
l'instruction
''
With .ChartObjects("graphe").ChartGroups(1).RadarAxisLabels '' si je
mets
dans mon module de classe :

ElseIf Range("RésultatTypeBorder").Value = "BS" Then ' l'axe des x
devient
Font
With .ChartObjects("graphe").ChartGroups(1).RadarAxisLabels
.AutoScaleFont = True
.Font.ColorIndex = iColor
End With

Comment corriger mon module de classe ?

@+ j'espère