PDA

View Full Version : vba powerpoint chart datalabel



balumail75
07-09-2020, 01:01 AM
Hi,

I am trying to change the chart datalabel font color to the color in fill color palette, through vba code.
the below code is not working. please help me.

Activewindow.Selection.ShapeRange(1).Chart.SeriesCollection(1).datalabels.f ont.color.objectthemecolor = msoThemeColorAccent5

Thanks and Regards,
Balu.

John Wilson
07-09-2020, 06:23 AM
Assuming you have a chart selected and only want to set the color for series 1


ActiveWindow.Selection.ShapeRange(1).Chart.SeriesCollection(1).DataLabels.F ormat.TextFrame2.TextRange.Font.Fill.ForeColor.ObjectThemeColor = msoThemeColorAccent5

balumail75
07-09-2020, 06:36 AM
Thank you John. it worked. life saver!!!.

balumail75
07-09-2020, 09:29 AM
Hello John,
Just for learning, what is the difference between the objectthemecolor vs schemecolor?
Am really confused with these two.

Thanks for the clarification.

Regards,
Balu.

John Wilson
07-09-2020, 09:46 AM
schemecolor (AFAIK) is for use with versions before 2007. You should use ObjectThemeColor in modern versions.

balumail75
07-09-2020, 09:45 PM
Hi John,

Thank you very much for the clarification.

Regards,
Balu.