Hi there,
From another application I import a group with a large number of rectangled shapes to Excel (a rasterized map). With VBA I loop a macro to ungroup to individual shapes (every 200 rectangles are grouped in a subgroup and ungouping gives a lot of Autoshapes which are deleted by the macro). The first 'group' to run into is always a msoPicture. When the msoPicture contains 10000+ shapes it suddenly gives an error, when it contains a number below 10,000 shapes shp.Ungoup works just fine.
After a lot of testing i found this limit of 10,000 shapes. Is this a known limitation? Any ideas for a bypass?
Code looks pretty simple, something like this:
From another application I import a group with a large number of rectangled shapes to Excel (a rasterized map). With VBA I loop a macro to ungroup to individual shapes (every 200 rectangles are grouped in a subgroup and ungouping gives a lot of Autoshapes which are deleted by the macro). The first 'group' to run into is always a msoPicture. When the msoPicture contains 10000+ shapes it suddenly gives an error, when it contains a number below 10,000 shapes shp.Ungoup works just fine.
After a lot of testing i found this limit of 10,000 shapes. Is this a known limitation? Any ideas for a bypass?
Code looks pretty simple, something like this:
Code:
Sub explodeGroup()
For Each shp In ActiveSheet.Shapes
If (shp.Type = 13) Or (shp.Type = 6) Then '13 = msoPicture, 6 = msoGroup
shp.Ungroup
Call explodeGroup
Exit Sub
ElseIf (shp.Type = 1) Then '1 = AutoShape
shp.Delete
Call explodeGroup
Exit Sub
Else
End If
Next
End Sub