PlotArea and GradientAngle

AgentSmith

Well-known Member
Joined
Mar 8, 2004
Messages
575
I have a chart which has a gradient fill in the Plot Area. For the chart to look right, users must adjust the gradient stop positions and angle of the gradient by eye. To help them I'm providing a couple of controls. The stop positions are easy enough to work with in VBA but I can't see how to work with the angle of the gradient. Individual series have a GradientAngle property (series.Format.Fill.GradientAngle) but the PlotArea.Format.Fill object does not.

Any suggestions how I can do something equivalent?
 

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
The GradientAngle property is a member of the FillFormat object which is returned by the Fill property. So this worked for me in Excel 2010:

MsgBox ActiveChart.PlotArea.Format.Fill.GradientAngle
 

AgentSmith

Well-known Member
Joined
Mar 8, 2004
Messages
575
I'm using Excel 2007 (no choice) and that doesn't work. I guess it must have been left out in the 2007 version.
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Yes the property was introduced in Excel 2010. I'm surprised that this works for you:

Series.Format.Fill.GradientAngle
 

AgentSmith

Well-known Member
Joined
Mar 8, 2004
Messages
575
Actually no it doesn't. (TBH I didn't test it because it wasn't what I wanted!)

I think I'm just going to leave it for the user to do via the conventional route. Thanks for the quick replies though :)
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,090,105
Messages
5,412,453
Members
403,428
Latest member
ldmcd

This Week's Hot Topics

Top