Oval fill and color

M

Mike

Hi. Someone helped me out with a macro to create an
oval. This oval currently has a transparent, green
background and a black line. Can someone tell me how to
make this oval have no fill and have a green line? Is
there somewhere in the excel/visual basic documentation
to find help with something like this in the future?

Here is the code:

Set myOval = .Parent.Shapes.AddShape(Type:=msoShapeOval, _
Top:=.Top, Left:=.Left,
Width:=.Width, Height:=.Height)
myOval.Fill.ForeColor.SchemeColor = 42
myOval.Fill.Transparency = 0.5

Thanks,
Mike.
 
D

Dave Peterson

You could look in the Help, but I like to record a macro when I do it once
choosing the colors/formats that I like:

Set myOval = .Parent.Shapes.AddShape(Type:=msoShapeOval, _
Top:=.Top, Left:=.Left, Width:=.Width, Height:=.Height)
myOval.Fill.Visible = msoFalse
myOval.Line.DashStyle = msoLineSolid
myOval.Line.ForeColor.SchemeColor = 11

This was the code that got recorded:

ActiveSheet.Shapes("Oval 439").Select
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 11
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)

I only kept the ones that I cared about.
 

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