Argh ! Series sous Excel

pystag Messages postés 13 Date d'inscription lundi 3 mai 2004 Statut Membre Dernière intervention 27 mai 2005 - 21 juin 2004 à 11:48
pystag Messages postés 13 Date d'inscription lundi 3 mai 2004 Statut Membre Dernière intervention 27 mai 2005 - 21 juin 2004 à 15:21
Salut!

Sous VB .NET, je réalise une feuille EXCEL et je veux y créer un graphique comportant des séries...
Je me suis inspiré d'une macro mais j'ai une erreur concernant l'affectation de XValues.
Je dois vraiment avoir de la m%@! dans les yeux (vous me direz que c'est lundi!)
Y a t'il quelqu'un pour m'aider

Merci

/** Code **/

AppExcel.Charts.Add()
AppExcel.ActiveChart.ChartType = Excel.XlChartType.xlLineMarkers
AppExcel.ActiveChart.SetSourceData(Source:=AppExcel.Sheets("Feuil1").Range("A1"), PlotBy:= _
Excel.XlRowCol.xlColumns)

AppExcel.ActiveChart.SeriesCollection.NewSeries()
AppExcel.ActiveChart.SeriesCollection(1).XValues = "=Feuil1!R5C1:R6C1"
AppExcel.ActiveChart.SeriesCollection(1).Values = "=Feuil1!R5C2:R6C2"
AppExcel.ActiveChart.Location(Where:=Excel.XlChartLocation.xlLocationAsObject, Name:="Feuil1")
AppExcel.ActiveChart.HasAxis(Excel.XlAxisType.xlCategory, Excel.XlAxisGroup.xlPrimary) = True
AppExcel.ActiveChart.HasAxis(Excel.XlAxisType.xlValue, Excel.XlAxisGroup.xlPrimary) = True
AppExcel.ActiveChart.Axes(Excel.XlAxisType.xlCategory, Excel.XlAxisGroup.xlPrimary).CategoryType = _
Excel.XlCategoryType.xlCategoryScale

/****/

pystag

1 réponse

pystag Messages postés 13 Date d'inscription lundi 3 mai 2004 Statut Membre Dernière intervention 27 mai 2005
21 juin 2004 à 15:21
Voilà le truc:

Suis-je bête!
sous VB .NET il faut plutôt un truc du genre :

/** Code **/

AppExcel.ActiveChart.SeriesCollection.Add(AppExcel.Sheets("Feuil1").Range("A5:B6"))

/****/
pystag
0
Rejoignez-nous