Hi Guys,
I've got this macro working in visio, but i'd like to launch from Excel. Can you write the code i have to change.
I think I have to add some "Dim" but I don't know how to write
Sub ConnectRectangles()
' need a couple shapes to connect.
Dim testShape1 As Visio.Shape
Dim testShape2 As Visio.Shape
' draw the shape object on the page
Set testShape1 = Visio.ActivePage.DrawRectangle(1, 1, 2, 2)
Set testShape2 = Visio.ActivePage.DrawRectangle(1, 9, 2, 10)
' define the selection object we will use to connect em.
Dim testSelection As Visio.Selection
' select the shapes via the selection object
Set testSelection = Visio.ActivePage.CreateSelection(visSelTypeAll)
' connect em all
testSelection.ConnectShapes
End Sub
THX
Bookmarks