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!
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
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"
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,777
Members
452,942
Latest member
VijayNewtoExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top