Runtime error 1004

roky92 Messages postés 3 Date d'inscription mercredi 27 décembre 2006 Statut Membre Dernière intervention 20 janvier 2007 - 16 janv. 2007 à 17:50
roky92 Messages postés 3 Date d'inscription mercredi 27 décembre 2006 Statut Membre Dernière intervention 20 janvier 2007 - 16 janv. 2007 à 19:42
Hello,

quand je lance une macro j ai le message d erreur suivant : '' Run-time error 1004  Unable to set Xvalue property of the Series class''  et des fois ca marche sans problemes. la macro est cense generer un graphes avec plsusieurs series.

merci

roky92 

2 réponses

cs_Jack Messages postés 14006 Date d'inscription samedi 29 décembre 2001 Statut Modérateur Dernière intervention 28 août 2015 79
16 janv. 2007 à 19:36
Salut
Si tu veux avoir des réponses, va falloir nous dire :
Dans quel logiciel tu fais ces macros (Ce ne sera pas du VB6, mais du VBA = catégorie "Langage dérivé")
Quelle est la syntaxe de la ligne générant ce défaut ...
Donc, il va falloir que tu pièges l'erreur dans ta macro pour qu'elle te dise où elle coince ...

Vala
Jack, MVP VB
NB : Je ne répondrai pas aux messages privés

Champion du monde de boule de cristal - 2005
Le savoir est la seule matière qui s'accroit quand on la partage (Socrate)
0
roky92 Messages postés 3 Date d'inscription mercredi 27 décembre 2006 Statut Membre Dernière intervention 20 janvier 2007
16 janv. 2007 à 19:42
la macro est faite dans XL c du VBA  voila le code et la ligne qui genere depend des fois mais elles sont en gras et souligne 


 


Sub Chart_EbitMargin_CEP()
    Application.CutCopyMode = False
    Charts.Add
    ActiveChart.ChartType = xlLineMarkers
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.SeriesCollection(1).XValues = "=EbitMargin!R6C9:R6C68"
    ActiveChart.SeriesCollection(1).Values = "= EbitMargin!R39C9:R39C68"
    ActiveChart.SeriesCollection(1).Name = "=""Low"""
    ActiveChart.SeriesCollection(2).Values = "=EbitMargin!R40C9:R40C68"
    ActiveChart.SeriesCollection(2).Name = "=""End of Q"""
    ActiveChart.SeriesCollection(3).Values = "=EbitMargin!R41C9:R41C68"
    ActiveChart.SeriesCollection(3).Name = "=""High"""
    ActiveChart.SeriesCollection(4).Values = "=EbitMargin!R42C9:R42C68"
    ActiveChart.SeriesCollection(4).Name = "=""Price"""
    ActiveChart.Location Where:=xlLocationAsObject, Name:="Chart EbitMargin"
    ActiveChart.HasDataTable = False
       ActiveChart.SeriesCollection(4).Select
    ActiveChart.SeriesCollection(4).AxisGroup = 2
    With Selection.Border
        .Weight = xlThick
        .LineStyle = xlNone
    End With
        With Selection.Border
        .ColorIndex = 3
        .Weight = xlThick
        .LineStyle = xlContinuous
    End With
    With Selection
        .MarkerBackgroundColorIndex = xlNone
        .MarkerForegroundColorIndex = xlNone
        .MarkerStyle = xlNone
        .Smooth = True
        .MarkerSize = 5
        .Shadow = False
    End With
    ActiveChart.SeriesCollection(2).Select
    ActiveChart.SeriesCollection(2).ChartType = xlXYScatter
    ActiveChart.SeriesCollection(2).Select
    With Selection.Border
        .Weight = xlHairline
        .LineStyle = xlNone
    End With
    With Selection
        .MarkerBackgroundColorIndex = xlAutomatic
        .MarkerForegroundColorIndex = xlAutomatic
        .MarkerStyle = xlCircle
        .Smooth = False
        .MarkerSize = 5
        .Shadow = False
    End With
    ActiveChart.ChartArea.Select
    With ActiveChart
        .HasTitle = True
        .ChartTitle.Characters.Text = "EBIT Margin Valuation Range for Comp Espanola Petroleos"
        .Axes(xlCategory, xlPrimary).HasTitle = True
        .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Date"
        .Axes(xlValue, xlPrimary).HasTitle = True
        .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Ebit Margin"
    End With
    ActiveChart.Axes(xlCategory).Select
    With ActiveChart.Axes(xlCategory)
        .CrossesAt = 1
        .TickLabelSpacing = 4
        .TickMarkSpacing = 1
        .AxisBetweenCategories = True
        .ReversePlotOrder = False
    End With
      
End Sub
0
Rejoignez-nous