Excel / VBA:在vba / excel中更改圆angular矩形的圆度

我想弄清楚如何使用VBA在Excel中更改圆angular矩形形状的圆度。

我从创build圆angular矩形开始,但是现在我不确定接下来要做什么。

Set roundedRec = ws.Shapes.AddShape(msoShapeRoundedRectangle, 10, 10, 200, 40) 

我已经search了excel vba rounded rectangle corner radius vba shapes roundness roundedexcel vba rounded rectangle corner radius和其他类似的短语,但没有发现任何非常有教育意义或有帮助的。 我开始认为我不能通过视觉基础来改变这个属性,尽pipe我可以通过Excel的GUI来完成。

msoShapeRoundedRectangle radius ,第一个链接有一个例子:

 With oSh oSh.AutoShapeType = msoShapeRoundedRectangle .Adjustments(1) = sngRounding End With 

形状对象有一个Fill属性,它具有方法

.OneColorGradient(Style,Variant,Degree)

.TwoColorGradient(Style,Variant)

使用检查

 Set shp = ActiveSheet.Shapes("Rounded Rectangle 1") shp.Adjustments(1) = shp.Adjustments(1) * 2 shp.Fill.ForeColor.RGB = RGB(0, 0, 128) shp.Fill.OneColorGradient msoGradientHorizontal, 1, 1