Object doesn't support this property or method --- ChartObject and seriesCollection

hrjohnson

New Member
Joined
Jan 28, 2014
Messages
24
Hello,

I have multiple charts embedded on a worksheet and I want to color every series point so they all look the same.
This is my sub:
Code:
Sub uniformChart()
Dim mapChart As ChartObject
Dim objSeries As Series
   For Each mapChart In ActiveWorkbook.Sheets("Home").ChartObjects
    With mapChart
         For Each objSeries In .SeriesCollection
            With objSeries
                                .MarkerStyle = xlMarkerStyleSquare
                                .Format.Fill.Solid
                                .MarkerBackgroundColor = RGB(51, 204, 204)
                                .MarkerSize = 6
    
            End With
         Next
    End With
  Next
End Sub
I get the error "Object Doesn't support this Property or Method" and it highlights "For Each objSeries In .SeriesCollection" line. I'm confused, I though Series Collection was a method of ChartObject?
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,370
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
A ChartObject is actually the container for an embedded Chart. You need to use:
Rich (BB code):
With mapChart.Chart
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,370
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
Glad to help. :)
 

Forum statistics

Threads
1,082,478
Messages
5,365,783
Members
400,850
Latest member
Raj_Jpr

Some videos you may like

This Week's Hot Topics

Top