View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Andrew[_16_] Andrew[_16_] is offline
external usenet poster
 
Posts: 66
Default Get the name of a group given the reference to a shape within the group

Thanks Jim,

I couldn't get this to work but had a look on MSDN and found that
'ParentGroup' was only made available in XL2002. I guess that means
I'm out of luck for now (only have XL2000).

Thanks anyway,
Andrew


"Jim Rech" wrote in message ...
Maybe you can use the ParentGroup object. For example:

Sub a()
Dim Sh As Shape
Dim Sh1 As Shape
On Error Resume Next
For Each Sh In ActiveSheet.Shapes
If Sh.Connector = msoTrue Then
Err.Number = 0
Set Sh1 = Sh.ConnectorFormat.BeginConnectedShape
If Err.Number < 0 Then GoTo NextShape
Debug.Print Sh1.ParentGroup.Name
If Err.Number = 0 Then GoTo NextShape
Debug.Print Sh1.Name
End If
NextShape:
Next
End Sub