Gluing to a Grouped Shape Using VBA

M

MikeM

Hi,

You've all been so helpful! Another question.

I create a line using

Set shLine = .DrawLine(1, 1, 2, 2)
Set clGlueStart = shLine.Cells("BeginX")


I have a grouped shape that contains a circle with different pie-shaped
segments and I'd like to glue one end of the line to that shape. I try it
using

Set cel1 = .Shapes("MyPie 1").Cells("PinX")
clGlueStart.GlueTo (cel1)

but I get a "Compile error: type mismatch" message.

Both clGlueStart and cel1 are dimensioned as cells, so that's not the
problem. And when I check to see if the two named cells have numerical
values, they do. What am I doing wrong?

Mike
 
C

Chris Roth [MVP]

Hi Mike,

One thing: VBA might be doing that "weird VBA parentheses thing", so these
might work better:

Call clGlueStart.GlueTo (cel1)

or

clGlueStart.GlueTo cel1

The other thing, your line is not a dynamic connector, and can't do the
"glue to PinX thing". You'll have top put a connection point on the pie
wedge and set cel1 to Shapes("MyPie 1").Cells("Connections.X1") or something
similar.

--
Hope this helps,

Chris Roth
Visio MVP

More Visio shapes, articles, development info and pure diagramming fun at:
www.wanderkind.com/visio
 
M

MikeM

Chris:

Right on target!!

Thanks,
Mike

Chris Roth said:
Hi Mike,

One thing: VBA might be doing that "weird VBA parentheses thing", so these
might work better:

Call clGlueStart.GlueTo (cel1)

or

clGlueStart.GlueTo cel1

The other thing, your line is not a dynamic connector, and can't do the
"glue to PinX thing". You'll have top put a connection point on the pie
wedge and set cel1 to Shapes("MyPie 1").Cells("Connections.X1") or something
similar.

--
Hope this helps,

Chris Roth
Visio MVP

More Visio shapes, articles, development info and pure diagramming fun at:
www.wanderkind.com/visio
 

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