B
Brian
I created the following code in Excel 2003 and it works fine.
With Worksheets("Chart")
With .Shapes("Customgrp").Duplicate
.Ungroup
End With
.Shapes("Customdmd").Name = "dmd" & sID
.Shapes("Customlin").Name = "lin" & sID
.Shapes("Customtxt").Name = "txt" & sID
.Shapes("txt" & sID).TextFrame.Characters.Text = ""
.Shapes("lin" & sID).Width = iDur2 * 1.168 - 5
With .Shapes.Range(Array("lin" & sID, "dmd" & sID, "txt"
& sID)).Group
.Name = "grp" & sID
End With
.Shapes("grp" & sID).Visible = True
.Shapes("grp" & sID).Left = lLeft
End With
When I run it in 2007, I get "Error 1004 Group has been disable for Object,"
for the With .Shapes.Range(...) Statement, or something like that. What's
the correct way to group shapes in excel 2007. I don't want to have to
select the object either. Also big picture, what I'm doing is I have a
custom shape that consists of a line a diamond and a text box, I need to
duplicate the custom shape, put something in the text box, and adjust the
width of the line, then put those three shapes back together, name the group,
and then place the group at a particular horizontal location on the
spreadhsheet. So if there's a better way to do it then let me know
Thanks in advance for your help
With Worksheets("Chart")
With .Shapes("Customgrp").Duplicate
.Ungroup
End With
.Shapes("Customdmd").Name = "dmd" & sID
.Shapes("Customlin").Name = "lin" & sID
.Shapes("Customtxt").Name = "txt" & sID
.Shapes("txt" & sID).TextFrame.Characters.Text = ""
.Shapes("lin" & sID).Width = iDur2 * 1.168 - 5
With .Shapes.Range(Array("lin" & sID, "dmd" & sID, "txt"
& sID)).Group
.Name = "grp" & sID
End With
.Shapes("grp" & sID).Visible = True
.Shapes("grp" & sID).Left = lLeft
End With
When I run it in 2007, I get "Error 1004 Group has been disable for Object,"
for the With .Shapes.Range(...) Statement, or something like that. What's
the correct way to group shapes in excel 2007. I don't want to have to
select the object either. Also big picture, what I'm doing is I have a
custom shape that consists of a line a diamond and a text box, I need to
duplicate the custom shape, put something in the text box, and adjust the
width of the line, then put those three shapes back together, name the group,
and then place the group at a particular horizontal location on the
spreadhsheet. So if there's a better way to do it then let me know
Thanks in advance for your help