Object doesn't support this ......

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Object doesn't support this ......

Post by VegasNath »

Please, what am I doing wrong here. :confused:
You do not have the required permissions to view the files attached to this post.
:wales: Nathan :uk:
There's no place like home.....

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: Object doesn't support this ......

Post by VegasNath »

The chart activates but I get the rte on all three of the following commands.
:wales: Nathan :uk:
There's no place like home.....

User avatar
HansV
Administrator
Posts: 78488
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Object doesn't support this ......

Post by HansV »

SetSourceData and SeriesCollection don't apply to a ChartObject (which is basically a shape object) but to the Chart contained in the ChartObject.
You probably don't need to activate the chart to manipulate it, so try

Code: Select all

    With ActiveSheet.ChartObjects("Chart 5").Chart
        .SetSourceData Source:=...
        .SeriesCollection(1).Name = "Blue"
        .SeriesCollection(2).Name = "Red"
    End With
Best wishes,
Hans

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: Object doesn't support this ......

Post by VegasNath »

Thanks Hans, that worked. :cheers:
:wales: Nathan :uk:
There's no place like home.....