Afficher/masquer graph : élément introuvable
Bonjour à tous,
J'ai un problème au niveau de mes graphiques. En effet, j'ai crée des graphiques que je souhaite afficher ou masquer en cliquant sur un CheckBox.
Cependant le code fonctionne deux fois et ensuite j'ai le message d'erreur suivant : Erreur d'execution 2147024809 (80070057), l'élément portant ce nom est introuvable.
Voici le code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| m = Sh9.Cells(Rows.Count, "B").End(xlUp).Row
If LIGNE_A.Value = True Then
ActiveSheet.ChartObjects("Graphique A1").Visible = True
ActiveSheet.ChartObjects("Graphique A2").Visible = True
With ActiveSheet.Shapes("Graphique A1")
.Height = 300
.Width = 655
.Left = Range("G" & m + 26).Left
.Top = Range("G" & m + 26).Top
End With
With ActiveSheet.Shapes("Graphique A2")
.Height = 300
.Width = 655
.Left = Range("Y" & m + 26).Left
.Top = Range("Y" & m + 26).Top
End With
Else
ActiveSheet.ChartObjects("Graphique A1").Visible = False
ActiveSheet.ChartObjects("Graphique A2").Visible = False
DeleteRows ("Ligne A") |
merci à vous tous pour votre aide.