LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default searching for shapes

Hi Peter,
I know it's going to get *very* fiddly *very* quickly - I have over 200
shapes on this sheet!
I've made a start with what you gave me, just testing stuff out. For a known
connector name *this* works:

Sub WhatsConnected()
Dim FromShape As String
Dim ToShape As String
FromShape = ActiveSheet.Shapes("AutoShape
407").ConnectorFormat.BeginConnectedShape.TextFram e.Characters.Text
ToShape = ActiveSheet.Shapes("AutoShape
407").ConnectorFormat.EndConnectedShape.TextFrame. Characters.Text
MsgBox FromShape & " --- " & ToShape
End Sub

I can't get it to work based on a selected connector. Is there something
like "ActiveShape" to use for referencing ?

I know I should be using Visio for this project.... :-(
--
David M
WinXP - Office2003 (Italian)


"Peter T" wrote:

Re Q1, this functionality is built in.

Customize toolbars
Commands, Drawing, Select Multiple Objects
drag onto your Drawing toolbar

(to list programmatically see following)

Re Q2, you need to look for connectors and see if 'both ends' are connected.
This should get you started -

Sub ListConnections()
Dim shp As Shape

For Each shp In ActiveSheet.Shapes
If shp.Connector Then
With shp.ConnectorFormat
If .BeginConnected And .EndConnected Then ' only if both
ends ?
Debug.Print shp.Name, .BeginConnectedShape.Name, .EndConnectedShape.Name
End If
End With
Else
Debug.Print shp.Name
End If
Next

End Sub

How to turn the results into something useful depends on what you want to do
and could get a bit fiddly.

Regards,
Peter T

"#DIV/0" wrote in message
...
Hi,
1. How can I fill a listbox with the names of all the shapes in a

worksheet ?
I've given them meaningful names so I can identify them.

2. From a selected shape is there a way to find out the names of any
connected shapes ?
eg. shape1 is connected to shape2, shape3 and shape4. If I select shape1

can
I get a list of the connected shapes ? Verifying the presence of

connectors
and seeing what's at the other end ?

--
David M
WinXP - Office2003 (Italian)




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel document with shapes on it but the shapes do not print [email protected] Excel Worksheet Functions 2 October 22nd 09 06:17 PM
Naming Auto Shapes and Creating new Shapes AL2000 Excel Discussion (Misc queries) 3 September 10th 07 04:12 AM
When drawing shapes in excel the shapes keep disappearing Tape Excel Discussion (Misc queries) 1 October 6th 06 04:23 PM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM


All times are GMT +1. The time now is 05:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"