Applying Radial Gradients To Shapes

rational_icthus

New Member
Joined
Mar 18, 2010
Messages
1
Hi,

I'm using Excel 2007, and I'm looking to apply a radial gradient to a Shape object via the TwoColorGradient method. Unfortunately, it doesn't appear that the MsoGradientStyle enum has an option for a radial gradient. Here's the code I'm using:

Code:
Set shp = Sheet1.AddShape(msoShapeOval, 100, 100, 25, 25)
shp.Fill.TwoColorGradient msoGradientFromCenter, 1
shp.Fill.GradientStops(1).Color.rgb = rgb(0, 0, 0)
shp.Fill.GradientStops(2).Color.rgb = rgb(255, 0, 0)

The 'msoGradientFromCenter' is the closest I've gotten to a true radial gradient, but it's not really radial. The macro recorder is useless for testing on shapes, so I'm really at a standstill.

Can anyone help?
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,858
Messages
5,766,796
Members
425,379
Latest member
thedoctor00

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top