0

Please note that in the following code arw represents arrows that are protruding from the bottom of a shape. For instances when a decision is needed, I also created a side arrow (identified as Sarw in the code). Note that for the side arrow, I specified it as a connector. I did this because I do not see that there is an adjustment on a line as there is one on the elbow connector. When I try to adjust the width of the elbow connector in my code, I am unsuccessful. I do not understand why. Any help that can be provided will be greatly appreciated. Thank you!

 'This first part places arrows on the bottom of a shape

 If rng.Offset(, 4).Value = " "
 GoTo Line1 'I wrote this part for when VBA expects a number & gets a blank
 End If

 Set arw = ws2.Shapes.AddLine(BegX, BegY, EndX, EndY)
 With arw
     .Line.BeginArrowheadStyle = msoArrowheadTriangle
     .Line.BeginArrowheadWidth = msoArrowheadWide
     .Line.ForeColor.RGB = RGB(0, 0, 0)

 End With


 'The following part is for the side arrows
 If rng.Offset(, 8).Value = " " Then
 GoTo Line2

 End If
 Set Sarw = ws2.Shapes.AddConnector(msoConnectorElbow, SBegX, SBegY, SEndX, SEndY)

 With Sarw

     .Line.BeginArrowheadStyle = msoArrowheadTriangle
     .Line.BeginArrowheadWidth = msoArrowheadWide
     .Line.ForeColor.RGB = RGB(0, 0, 0)
     .Adjustments.Item(1) = 45

 End With
CPILon
  • 23
  • 8

2 Answers2

0

This appeared to work for me. I can't see anything in your code that would do anything to the width?

Sub Macro1()

Dim s As Shape

Set s = ActiveSheet.Shapes.AddConnector(msoConnectorElbow, 10, 10, 50, 50)

s.Line.Weight = 5

End Sub
SJR
  • 22,986
  • 6
  • 18
  • 26
  • I will try this. Please note that I used Adjustments.Item(1) = 90. The reason I did this is because I recorded a macro where by I connected two shapes with an elbow connector. Then, I changed the width of the connector. According to the Macro, the Adjustment accounts for the width. – CPILon Aug 28 '18 at 15:27
0

SJR...I tried your method. Unless I am misunderstanding, this appears to adjust the thickness of the line. Note that if you were to change the weight from 5 to 90, the line appears more like a rectangle. I am attaching a graphic to demonstrate the effect for which I am aiming. I hope this helps. Please let me know if I have misunderstood your example. Thanks!

Click here for example

CPILon
  • 23
  • 8
  • SJR...I noted that your coordinates were different from mine. You had 10,10,50,50. I employed this method and saw that you have a connector with the shapes being on opposite sides, if you will. I have tinkered around with this to get it to work. Essentially, I set my coordinates to 70,10,50,60. Additionally, I had to specify properties for the arrowhead. Finally, when I used Adjustments.Item(1) = 2, the positioning was just as I wanted it. Thank you for your help with this! – CPILon Aug 28 '18 at 21:34