I work in Excel 2013 to (programmatically) add a line connector between the bottom right corner of a rectangle that is part of a grouped shape with the end point of a grouped series of line segments. Be that as it may, I can't even do it manually on an Excel worksheet that contains these shapes.
The problems include:
- Only the middle on the desired rectangle will accept the connector.
- A grouped series of line segments does not even show a “connection point” for the end end of a straight line connector.
Here is an image of what I'm trying to do:
[I do not have 10 "reputation points", so I can’t post a photo of what I'm trying to do. Not a particularly useful feature! How to get reputation points in this game?]
I was able to create and name two groups and thought that I would work with them to add a connector, but this is not so.
Here is the code I worked with:
Sub create_new_profile()
Dim firstRect As Shape
Dim firstLine As Shape
Set myDocument = Worksheets(1)
Set s = myDocument.Shapes
' Set firstRect = s.Range("shpNewGarage")
' Set firstLine = s.Range("shpProfile")
Dim Shp As Shape
' For Each Shp In myDocument.Shapes
For Each Shp In s
If Shp.Name = "shpNewGarage" Then
Set firstRect = Shp
Else
End If
Next Shp
' For Each Shp In myDocument.Shapes
For Each Shp In s
If Shp.Name = "shpProfile" Then
Set firstLine = Shp
Else
End If
Next Shp
firstRect.Select 'this works
firstLine.Select 'this works
' Set firstRect = s.AddShape(msoShapeRectangle, 100, 50, 200, 100)
' Set firstLine = s.AddShape(msoShapeRectangle, 300, 300, 200, 100)
' Set firstRect = ActiveSheet.Shapes.Range("shpNewGarage")
' Set firstLine = ActiveSheet.Shapes.Range("shpProfile")
Dim c As Shape
Set c = s.AddConnector(msoConnectorStraight, 0, 0, 100, 100)
' On Error Resume Next
With c.ConnectorFormat
**.BeginConnect ConnectedShape:=firstRect, ConnectionSite:=1**
.EndConnect ConnectedShape:=firstLine, ConnectionSite:=1
' .BeginConnect ConnectedShape:="shpNewGarage", ConnectionSite:=1
' .EndConnect ConnectedShape:="shpProfile", ConnectionSite:=1
' .BeginConnect ConnectedShape:=ActiveSheet.Shapes.Range("shpNewGarage"), ConnectionSite:=1
' .EndConnect ConnectedShape:=ActiveSheet.Shapes.Range("shpProfile"), ConnectionSite:=1
c.RerouteConnections
End With
End Sub
This particular version of the code ends with a runtime error on the line following the line:
With c.ConnectorFormat
Here is the error message:
[I do not have 10 "reputation points", so I can not post the image of the error message that I receive. Again, how do I get reputation points?]
Any direction to help me accomplish this task programmatically would be very helpful.
Thanks for explaining that now I can send images. This should help.
, :

(firstRect, "shpNewGarage" ) , . (firstLine, "shpProfile" ) ( /) ( ). , ( ) (), , , , , , ( ) .
, :

, , .
, / . Stackoverflow , , .