LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
TV TV is offline
external usenet poster
 
Posts: 2
Default Shapes and VBA in Excel 2000 and 2002

I have a large amount of shape-groups that I want to manipulate by
VBA.
All the groups are basicly the same structure and consists of several
other shape-groups. So my structure looks something like this
(simplified):

Group "Group AA1" contains groups named: "Subgroup SS1" and "Subgroup
SS2" each containing shapes named: "Line1" and "Line2"
Group "Group AA2" also contains groups named: "Subgroup SS1" and
"Subgroup SS2" each again containing shapes named: "Line1" and "Line2"

The task is to access a specific subgroup whitin a maingroup - and
return this group as a shape-object.

This code works in Xl 2000:

-----
Public Function SubShape(ByVal ParentShape As Shape, sID As String) As
Shape
Dim i As Integer

With ParentShape
For i = 1 To .GroupItems.Count 'Evaluates to 2
If .GroupItems(i).Name = sID Then
Set SubShape = .GroupItems(i)
Exit For
End If
Next i
End With

End Function

---------
Sub ShapeTest()

Dim AllShapes As Shapes
Dim MainShape As Shape
Dim MyShape As Shape

Set AllShapes = ActiveSheet.Shapes
Set MainShape = AllShapes("Group AA1")

Set MyShape = SubShape(MainShape, "Subgroup SS1")

End Sub

BUT in Xl 2002 (v10):
GroupItems.Count evalutes to 4 (Number of lines) and it is not
possible - or is it - to return the embedded shape-group.

ANY idea to overcome the problem - preferebly in a way that works both
in Xl2000 and Xl2002 - and maybe even in a later version.
Deadline is closing so any help appreciated.

Thomas Voetmann
 
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 2000 to 2002 - #NAME? Paulo Freixieiro Excel Discussion (Misc queries) 6 September 7th 05 01:33 PM
Excel 2000 to 2002 - #NAME? Paulo Freixieiro Excel Discussion (Misc queries) 1 September 7th 05 01:12 AM
Excel 2000 and 2002 Tim Childs Excel Programming 3 October 22nd 03 01:23 AM
Excel 2000-2002 compability Chrissy[_4_] Excel Programming 5 August 3rd 03 04:24 AM


All times are GMT +1. The time now is 10:14 AM.

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"