Bonjour à tous,
Je sèche sur un sujet de mise à jour de plage graphique.
J'ai ceci, qui fonctionne très bien :
Plage_Graphique_TT "Collecte d'infos", "Vérif_DiagrammeTT", i, 66, 2, 66 + i, ProchaineColonne
Et voici le détail de Plage_Graphique_TT :
Sub Plage_Graphique_TT(ByVal Onglet As String, ByVal Graphique As String, ByVal Serie As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal A As Integer, ByVal B As Integer)
With Worksheets(Onglet).ChartObjects(Graphique).Chart.SeriesCollection(Serie)
.XValues = Worksheets("Collecte d'infos").Range(Cells(X, Y), Cells(X, B))
.Values = Worksheets("Collecte d'infos").Range(Cells(A, Y), Cells(A, B))
End With
End Sub
Je souhaite utiliser le même mécanisme pour un autre graphique, mais dont j'identifie la série par une chaîne plutôt qu'un entier.
Et là, Excel me renvoie une "erreur d'exécution 13 : incompatibilité de type".
Voici mon appel :
Plage_Graphique_IM "Collecte d'infos", "Vérif_Déploiement1", "Prévision (+) Installations OK", 125, 3, 132, ProchaineColonne
Et voici le détail de Plage_Graphique_IM :
Sub Plage_Graphique_IM(ByVal Onglet As String, ByVal Graphique As String, ByVal Serie As String, ByVal X As Integer, ByVal Y As Integer, ByVal A As Integer, ByVal B As Integer)
With Worksheets(Onglet).ChartObjects(Graphique).Chart.SeriesCollection(Serie)
.XValues = Worksheets("Collecte d'infos").Range(Cells(X, Y), Cells(X, B))
.Values = Worksheets("Collecte d'infos").Range(Cells(A, Y), Cells(A, B))
End With
End Sub
Comme vous le voyez, je ne fais qu'indiquer que Serie est une String et pas un Integer, et je passe bien une chaîne de caractères en argument dans mon appel.
Sachant que .SeriesCollection("Toto") fonctionne bien, je l'ai essayé par ailleurs.
Avez-vous des idées ?
Un grand merci par avance !