简体   繁体   中英

want change selected powerpoint chart series color in vba

Dim p As Point
Dim s As Series
Dim c As Chart

Set c = ActiveWindow.Selection.ShapeRange(1).Chart
Set s = c.SeriesCollection(1)

With s
    .ChartType = xlColumnClustered
    .Format.Fill.ForeColor.RGB = RGB(25, 26, 24)
End With    

End Sub

The syntax seems to be correct. You simply need to make sure that you select your chart before running the macro. Otherwise, you'll get a run-time error "Selection (unknown member): Invalid request. Nothing appropriate is currently selected."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM