Unable to turn off marker shadows in charts on sheet through vba

Joined
Jul 28, 2011
Messages
13
I have a bunch of charts and all the markers have shadowing on them, and I wrote a macro to go through them all to remove the shadowing. I based this macro off of recorded macro I made by removing the shadwos on the first chart. When I run it, it selects the data series and everything, but doesn't actually modify the shadow settings for that data series. The shadow is still there and it shows that it still has a shadow. I don't understand why it is doing this.

Also, if I try to modify the chart name it says something about being "out of memory". Am I doing that wrong?

Code:
Sub removeShadows()
'
' Macro8 Macro
'

'
    Dim ch As Chart
    Dim i As Long

    
    Sheets("MySheet").Select
    For i = 1 To ActiveSheet.ChartObjects.count
        ActiveSheet.ChartObjects(i).Activate
        'ActiveChart.Name = "ConsLM_" & i
        ActiveChart.SeriesCollection(1).Select
        Selection.Format.Shadow.Visible = msoFalse
        ActiveChart.SeriesCollection(2).Select
        Selection.Format.Shadow.Visible = msoFalse
    Next i
    

    
    
End Sub


THANK YOU!
 
Joined
Jul 28, 2011
Messages
13
OK, so doing
ActiveChart.SeriesCollection(1).Format.Shadow.Type = msoShadow1
ActiveChart.SeriesCollection(2).Format.Shadow.Type = msoShadow1

or anything number besides 1 for that matter, seems to remove the shadow, but when you go into the marker options, it doesn't show anything selected for "Shadow" in the menu, not even "No Shadow"
 

Forum statistics

Threads
1,081,564
Messages
5,359,622
Members
400,540
Latest member
JimUSMC

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top