The following code was used to create a chart in excel 2003, but doesn't seem to work in excel 2010? When I run the debugger, the line in red below is highlighted. I am a new user of VBA, please help!
Rich (BB code):
Sub TraceXYMulti()
Dim myCht As Chart
Dim mySrs As Series, Isrs As Integer
Dim Npts As Integer, Ipts As Integer
Dim myBuilder As FreeformBuilder
Dim myShape As Shape
Dim Xnode As Double, Ynode As Double
Dim Xmin As Double, Xmax As Double
Dim Ymin As Double, Ymax As Double
Dim Xleft As Double, Ytop As Double
Dim Xwidth As Double, Yheight As Double
Dim Xnodes As Double, Ynodes As Double
ActiveSheet.ChartObjects(1).Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.Crosses = xlCustom
.CrossesAt = Sheets("Yield Mix Logic").Range("C2")
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
ActiveSheet.ChartObjects(1).Select
Set myCht = ActiveChart
With myCht
For x = .Shapes.Count To 1 Step -1
With .Shapes(x)
.Delete
End With
Next x
End With
Last edited by a moderator: