-
Shape Selection Dynamically
i want to make custom flowchart software in the excel and i succeed to make shapes and arrows etc with VBA
now the problem comes when i want to add the elbow arrow between the two shapes which are not aligned.
i can do this with the Activesheets.shapes.addconnector(msoconnectorebow,x1,y1,x2,y2).select
the main thing here is that i don't want to specify the value of x1.y1.x2.y2 in the function but i want to select the two shapes and to draw the arrow dynamically
can anybody help me to activate this command only with vba?
-
You can use the Left, Top, Width and Height of the selected Shapes.
Use an Offset for the Elbow Top and Left from these figures.
I used this to give me all the coordinates for a bunch of lines. (Type 9)
[VBA]Sub Get_Coords_A()
Dim ln As Shape
For Each ln In ActiveSheet.Shapes
If ln.Type = 9 Then
With Cells(Rows.Count, "P").End(xlUp)(2)
.Value = ln.Left
.Offset(, 1).Value = ln.Top
.Offset(, 2).Value = ln.Width
.Offset(, 3).Value = ln.Height
End With
End If
Next ln
End Sub[/VBA]
-
I just want to activate the elbow arrow connector command with vba only
if i activate only this command then it will give me the on screen selection of the shapes to make arrow between them, after words i can change the property of this arrow by vba code
Rest of the matter will be taken care by my code
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules