Alan Júlio
11-13-2009, 06:07 AM
Hi folks,
I have a problem in my code. When I try to access the Axes method or any other property or method of Chart Object (which belongs to ChartM object), VBA stops because a runtime error (1004) saying that the method (or property) of the '_Chart' failed.
Dim chartM As ChartObject: Set chartM = sheetXi.ChartObjects.Add(100, 10, 600, 200)
Dim serieM As Series: Set serieM = hartM.Chart.SeriesCollection.NewSeries
serieM.Values = mSerieM: serieM.XValues = mSerieIndex
With chartM 'formatting
.Name = "Amostras para média"
With .Chart
.ChartType = xlLine
.PlotArea.Interior.Color = vbWhite
With .Axes(xlValues).MajorGridlines.Border 'the problem is here
.ColorIndex = 57
.Weight = xlHairline
.LineStyle = xlDot
End With
End With
End With
Did somedy have this problem? May you help me?
Thanks. See u.
I have a problem in my code. When I try to access the Axes method or any other property or method of Chart Object (which belongs to ChartM object), VBA stops because a runtime error (1004) saying that the method (or property) of the '_Chart' failed.
Dim chartM As ChartObject: Set chartM = sheetXi.ChartObjects.Add(100, 10, 600, 200)
Dim serieM As Series: Set serieM = hartM.Chart.SeriesCollection.NewSeries
serieM.Values = mSerieM: serieM.XValues = mSerieIndex
With chartM 'formatting
.Name = "Amostras para média"
With .Chart
.ChartType = xlLine
.PlotArea.Interior.Color = vbWhite
With .Axes(xlValues).MajorGridlines.Border 'the problem is here
.ColorIndex = 57
.Weight = xlHairline
.LineStyle = xlDot
End With
End With
End With
Did somedy have this problem? May you help me?
Thanks. See u.