We start with some Excel 2007 VBA to draw a shape of several parts, and to group those parts. Somewhat condensed for legibility, the code so far looks like:
So far, so good.Please Login or Register to view this content.
Then
That works fine (even if I can't explain why it has a lower-case "s" on "shapes"). But then I run the code again and Excel reportsPlease Login or Register to view this content.
> Run-time error '1004':
> Grouping is disabled for the selected shapes.
My guess is that Excel 2007 is attempting to group the first-made items with names "Part1" and "Part2", which are already part of a group. Hence the failure.
Please, is it possible to specify the Shapes.Range(Array(...)) using the shape pointers (sh1 and sh2) rather than the names?
Thank you.
Bookmarks