Format Shape Using ThemeColors

R

Roger

I can format shapes with RGB
ActiveSheet.Shapes("Test").Fill.ForeColor.RGB = RGB(128, 128, 128)
Is there a way to format a shape using themecolors in the same way you can
format a cell
With Range("A1").Interior
..ThemeColor = xlThemeColorAccent3
..TintAndShade = 0.799981688894314
End With
I have tried every variation of the code & syntax to no avail - could
someone give me an example of the code to do this please - thankyou in
anticipation
 
J

JLGWhiz

Does not the objects in a theme have to be defined, such as frame, title
window, menu bar, etc. It would seem to me that to set a theme for shapes,
you would have to define what shapes belong to the theme and have some
pre-determined method of defining whether the interior fills or the lines
adapt a color, etc. I do not believe that excel has a facility for just
using a theme to color an abstract group of shapes.
 
P

Peter T

Dim shp As Shape
Set shp = ActiveSheet.Shapes("Test")
shp.Fill.ForeColor.ObjectThemeColor = msoThemeColorAccent3
shp.Fill.ForeColor.TintAndShade = 0.799981688894314

' and for the border, or
shp.Line.ForeColor.ObjectThemeColor = msoThemeColorAccent3

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top