D
Dan
Can anyone help me figure out why this routine never finds the connectors
(there are at least two) on the sheet?
"r" is a range, by the way.
The loop never runs, apparently it doesn't find the type 2 shape
(ConnectorElbow):
For Each sh In ActiveSheet.Shapes
If sh.Type = 2 Then 'I think 2 is a MsoConnectorElbow shape
With sh.ConnectorFormat
Set endsh = .EndConnectedShape 'endsh is the name of the
shape that the line is connected to
Set begsh = .BeginConnectedShape 'begsh is the name of the
shape at the beginning of the line.
End With
Set isect1 = Application.Intersect(Range("r"), Range(endsh.Range))
Set isect2 = Application.Intersect(Range("r"), Range(begsh.Range))
If (isect1 Is Nothing) And (isect2 Is Nothing) Then 'this is not the
droid you are looking for
'do nothing, continue in the loop
Else 'found the connector, need to kill it.
sh.Delete
End If
End If
Next sh
Thanks!
(there are at least two) on the sheet?
"r" is a range, by the way.
The loop never runs, apparently it doesn't find the type 2 shape
(ConnectorElbow):
For Each sh In ActiveSheet.Shapes
If sh.Type = 2 Then 'I think 2 is a MsoConnectorElbow shape
With sh.ConnectorFormat
Set endsh = .EndConnectedShape 'endsh is the name of the
shape that the line is connected to
Set begsh = .BeginConnectedShape 'begsh is the name of the
shape at the beginning of the line.
End With
Set isect1 = Application.Intersect(Range("r"), Range(endsh.Range))
Set isect2 = Application.Intersect(Range("r"), Range(begsh.Range))
If (isect1 Is Nothing) And (isect2 Is Nothing) Then 'this is not the
droid you are looking for
'do nothing, continue in the loop
Else 'found the connector, need to kill it.
sh.Delete
End If
End If
Next sh
Thanks!