Hi Steve,
I noticed that if you apply a layer to a shape *after* a data graphic is
applied, then the data graphic will take the layer.
This works even if you "re-apply" the layer. (ie: Shape > Layer, do
nothing but click OK -- effectively re-applying the same layer(s) to the
shape)
But if you look at the macro-recorder code, you'll see that Visio did
indeed loop through all the shapes and sub-shapes and apply the "new"
layer to the shape, which is probably what you were trying to avoid.
You might try something like making a formula in the data graphic that
refers to the group's LayerMember cell. The formula would look like this:
(for the data graphic)
LayerMember = Sheet.5!LayerMember
(sheet.5 is the group)
In code, it might go something like this:
dgShp.Cells("LayerMember").Formula =
dgShp.ContainingShape.NameID & "!LayerMember"
--
Hope this helps,
Chris Roth
Visio MVP
Visio Guy: Smart Graphics for Visual People
http://www.visguy.com