View Single Post
 
Old 06-26-2019, 04:35 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,967
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Your code works fine on my machine. I don't know what is going wrong on your machine. Perhaps a reboot is in order.

Maybe you could try including a debug.print statement to find out what masters it is trying to match with
Code:
Sub SelectSimilarShapesByMaster()
  Dim SelShp As Visio.Shape, CheckShp As Visio.Shape
  If ActiveWindow.Selection.Count > 0 Then
    Set SelShp = ActiveWindow.Selection(1)
    If SelShp.Master Is Nothing Then Exit Sub
    For Each CheckShp In ActivePage.Shapes
      If Not CheckShp.Master Is Nothing Then
        Debug.Print SelShp.Master, CheckShp.Master
        If CheckShp.Master = SelShp.Master Then
          ActiveWindow.Select CheckShp, visSelect
        End If
      End If
    Next CheckShp
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote