Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Name an Embbeded Chart

Status
Not open for further replies.

remeng

Technical User
Jul 27, 2006
523
US
Hi all:

I have been attempting to name an embeded chart so that I can set it's location. The problem is that the chart when it is Embedded will not allow me to retain its name. Here is my code.

Thanks!

Code:
Charts.Add

With ActiveChart
    .Name = "RandomName"
    .ChartType = xlXYScatterLines
    .SetSourceData Source:=Sheets("Horizontal").Range("EB2:EB4"), _
        PlotBy:=xlColumns
    .SeriesCollection(1).Delete
    .SeriesCollection.NewSeries
    .SeriesCollection.NewSeries
    .SeriesCollection.NewSeries
    .SeriesCollection(1).XValues = ValueXchart
    .SeriesCollection(1).Values = Value1chart
    .SeriesCollection(1).Name = Value1name
    .SeriesCollection(2).XValues = ValueXchart
    .SeriesCollection(2).Values = Value2chart
    .SeriesCollection(2).Name = Value2name
    .SeriesCollection(3).XValues = ValueXchart
    .SeriesCollection(3).Values = Value3chart
    .SeriesCollection(3).Name = Value3name
    .Location Where:=xlLocationAsObject, Name:="Summary"
End With

ActiveChart.ChartArea.Select
ActiveSheet.ChartObject("RandomName").IncrementLeft -165#
ActiveSheet.ChartObject("RandomName).IncrementTop 63.75
 
RandomName is supposed to be the name of a Chart, not of a ChartObject.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
So, I have taken that line out, but how do I name the newly created embeded chart?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top