Michael Ziegler
New Member
- Joined
- Jul 2, 2019
- Messages
- 8
I am trying to connect the visio shapes in my drawing. I am using autoconnect. I have a loop that goes thru all the visio shapes in my drawing. It goes thru the values in my range and compares them to the shape name, if the shape name matches then it should connect to the shape who has the name stored in the offset (0, 2) of my range variable but I’m having problems passing the variable to the script. If I do a debug print for the variable that stores the shape names to connect to then it prints to screen the names of the shapes that the current shape in the loop needs to connect to. So it has the correct data.
Here is some of the code.
I need to be able to pass the content of the variable to this statement.
Thanks
Here is some of the code.
Code:
Dim conns As Range
Dim connto_str As String
Dim ew As Excel.Workbook
Set ew = wbkInst.ActiveWorkbook
Dim conns As Range
Dim cel As Range
Dim ws As Worksheet
For Each ws In ew.Sheets
Set conns = ws.Range("j3:j22")
For Each cel In conns
With cel
c = cel.Value
connto_str = cel.Offset(0, 2).Value
End With
For Each node In ActivePage.Shapes
If node.Name = c Then
node.AutoConnect connto_str, visAutoConnectDirNone
'Debug.Print connto_str
Else
End If
Next node
Next cel
Next ws
I need to be able to pass the content of the variable to this statement.
Code:
node.AutoConnect connto_str, visAutoConnectDirNone
Thanks