N
Nichevo
Hiya
I'm trying to draw around a circle using a freeform drawing but I can seem to figure out the drawing of the curve - This is what I have so far:
Sub Macro8()
Set ws = ThisWorkbook.Worksheet("Sheet1")
x = 1200
y = 100
SV = 100
'Draws the Circle
With ws.Shapes.AddShape(msoShapeOval, x, y, SV, SV)
.Fill.ForeColor.SchemeColor = 2
.Line.Visible = msoFalse
End With
'Draws the Segement of the Circle
With ws.Shapes.BuildFreeform(msoEditingAuto, x + SV / 2, y)
.AddNodes msoSegmentLine, msoEditingAuto, x + SV / 2, y + SV / 2
.AddNodes msoSegmentLine, msoEditingAuto, x, y + SV / 2
'Part of the program I'm struggling with
.AddNodes msoSegmentLinem, msoEditingCorner, x + SV / 4, y + SV / 4, x + (SV / 4) * 2, y + (SV / 4) * 2, x + SV / 2, y
.ConvertToShape.Select
End With
End Sub
The part I'm having trouble with is
..AddNodes msoSegmentLinem, msoEditingCorner, x + SV / 4, y + SV / 4, x + (SV / 4) * 2, y + (SV / 4) * 2, x + SV / 2, y
I can draw a straight line back but I want to make it curved and it keeps bringing up and error about a value being out of range when I get to this line - anyone have any ideas.
I'm trying to draw around a circle using a freeform drawing but I can seem to figure out the drawing of the curve - This is what I have so far:
Sub Macro8()
Set ws = ThisWorkbook.Worksheet("Sheet1")
x = 1200
y = 100
SV = 100
'Draws the Circle
With ws.Shapes.AddShape(msoShapeOval, x, y, SV, SV)
.Fill.ForeColor.SchemeColor = 2
.Line.Visible = msoFalse
End With
'Draws the Segement of the Circle
With ws.Shapes.BuildFreeform(msoEditingAuto, x + SV / 2, y)
.AddNodes msoSegmentLine, msoEditingAuto, x + SV / 2, y + SV / 2
.AddNodes msoSegmentLine, msoEditingAuto, x, y + SV / 2
'Part of the program I'm struggling with
.AddNodes msoSegmentLinem, msoEditingCorner, x + SV / 4, y + SV / 4, x + (SV / 4) * 2, y + (SV / 4) * 2, x + SV / 2, y
.ConvertToShape.Select
End With
End Sub
The part I'm having trouble with is
..AddNodes msoSegmentLinem, msoEditingCorner, x + SV / 4, y + SV / 4, x + (SV / 4) * 2, y + (SV / 4) * 2, x + SV / 2, y
I can draw a straight line back but I want to make it curved and it keeps bringing up and error about a value being out of range when I get to this line - anyone have any ideas.