Jaymond Flurrie
Well-known Member
- Joined
- Sep 22, 2008
- Messages
- 921
- Office Version
- 365
- Platform
- Windows
I'm trying to change the color of my embedded chart font to white, but even recording it gives something weird as the result and when I try to execute that, it gives an error. Here's what the recording gives:
Which one of those is the actual font color? I would like to perform the whole system with one line, something like:
ActiveSheet.ChartObjects("EmbeddedChart").SeriesCollection(2).DataLabels.Format.TextFrame2.TextRange.Font.ForeColor.RGB = RGB(255,255,255)
It also seems like Excel doesn't like the .Axes(xlCategory).Format part and I can't even find the Format property from anywhere but the recorded code (tried for example MSDN). What's the way to access the font?
Code:
ActiveSheet.ChartObjects("EmbeddedChart").Activate
ActiveChart.SeriesCollection(2).DataLabels.Select
With Selection.Format.TextFrame2.TextRange.Font
.BaselineOffset = 0
.Fill.Visible = msoTrue
.Fill.ForeColor.ObjectThemeColor = msoThemeColorBackground1
.Fill.ForeColor.TintAndShade = 0
.Fill.ForeColor.Brightness = 0
.Fill.Transparency = 0
.Fill.Solid
End With
Which one of those is the actual font color? I would like to perform the whole system with one line, something like:
ActiveSheet.ChartObjects("EmbeddedChart").SeriesCollection(2).DataLabels.Format.TextFrame2.TextRange.Font.ForeColor.RGB = RGB(255,255,255)
It also seems like Excel doesn't like the .Axes(xlCategory).Format part and I can't even find the Format property from anywhere but the recorded code (tried for example MSDN). What's the way to access the font?