My own customized Data Graphic

J

JuneTheSecond \)cotton.ocn.ne.jp>

Hi mikeFin,

The name of the main shape could be
found by the menu, Format/Object Information.
And you could see with Drawing Explorer.

By the way, if you added the data graphics to
the shape, the shape changes to a parent of
the group. This change could be seen by the
menu, Format/Object Information.
The datagraphics that you added are the
child shapes of the group parent shape.

--
Best Regards.

JuneTheSecond
Now the Visual calculation is more visual.
http://www.geocities.jp/visualcalculation/english/index.html
 
M

mikeFin

thanks for the helping.

Sorry, I might not have been enough precise... what I need is a way to use
the name of the parent shape before (!) I have added the dataGraphic to the
shape.
I am doing the changes in the document stencil, so I don't know yet, which
sheet this will be.
This may sound impossible at first, but in the example in the blog post (see
link above) the shape called sheet1 gets renamed automatically when applied
as dataGraphic. So I thougt maybe there is a way to do this too, and Visio
will rename the sheet-Number correctly when it will know to which shape I
want to add the datagraphic.

If there is no way to do that in the ShapeSheet of the DataGraphic, I will
try to do that with VBA.
The solution won't be so nice, but I guess I can make it work by doing this

- - -
Somewhere in a User-defined cell, I will have the function
Callthis("module1.function_change_dataGrapic_width",)+DEPENDSON(Prop.msvCalloutField)

and in the VBA function get the name like this

Sub function_change_dataGrapic_width(vsShape as Shape)
....
Split(vsShape,"!")
vsShape.Cells("Width") = ...
....
End Sub

- - -

I hope this will work.
If someone has an easier or cleaner way to achieve this, it would be great.

Thanks!
 
J

JuneTheSecond \)cotton.ocn.ne.jp>

mikeFin,

Shape.Master property and Shape.Shapes property
could see the name in the drawing master,
if you need to know how the shape
name is renamed when dropped on the drawing.

Here is my test code for a stander datagraphic.
It is looking in the group.

Sub test()
Dim shp As Visio.Shape
Set shp = ActivePage.Shapes(1)
' Debug.Print shp.Name
Dim child As Visio.Shape
Set child = shp.Shapes(1)
' Debug.Print child.Name
Dim grandkid As Visio.Shape
Set grandkid = child.Shapes(1)
' Debug.Print grandkid.Name, grandkid.Master.Name
Dim mst As Visio.Master
Set mst = grandkid.Master
Debug.Print mst.Shapes(1).Shapes(1).Shapes(1).Name
End Sub

--
Best Regards.

JuneTheSecond
Now the Visual calculation is more visual.
http://www.geocities.jp/visualcalculation/english/index.html
!
 
M

mikeFin

The line

Set grandkid = child.Shapes(1)

brings this error: "Invalid Sheet indentifier".


When I put some of your code in the following function that is being called
by the DataGraphic through Callthis(...,)+DEPENDSON(...)

Sub function_change_dataGrapic_width(vsShape as Shape)
Dim mst1 As Visio.Master
Set mst1 = vsShape.Master
MsgBox mst1.Name
End Sub

it DOES give me the name of the shape I am looking for!!
Unfortunately I also get the following error

"Object variable or With block not set"

Why that?
What can I do?

Many thanks already!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top