Runtime Errors

G

googull

I am executing the following in Visio 2002:
--------------
Dim newshape, ClonShp, IntoShp as Visio.Shapes

'IntoShp is a subshape of the group that I want to clone into.

Set newshape = IntoShp.Parent.Drop(ClonShp, 0, 0)
-------------
in an effort to clone a shape into a group. It works when I run the
subroutine once. But whenever I call the subroutine more than once it fails
on the 2nd call with a "Run-time error (86db089c) Operation succeeded but no
object returned". Unfortunately it really doesn't succeed. I've tried
recoding many ways but always get the same result. Any advice on this error
or what I may be doing to fail this would be appreciated.
 
C

Chris [Visio MVP]

If you're using VB6 or VBA, then you need to dimension the objects as Shape,
not Shapes, and each item needs to be typed - VB6 doesn't support just one
type at the end. The first two will simply be Objects.

Dim newShape as Visio.Shape, ClonShp as Visio.Shape, IntoShp as Visio.Shape
 
P

pschatz

Using Visio 2003 Pro, I'm getting the "Operation succeeded but no objec
returned" exception roughly half the time when i try to drop a grou
shape into another group shape. When the child shapes were simpl
rectangles, i never got any of these errors. I have now changed th
master of the child shape to a group and am getting the errors on som
of the drops. Is this related to the child shapes being groups? Se
below for code snipit.


Pete


if((TargetOpNode != null)&&(TargetSystem != null))
{
TargetOpNode.Drop(TargetSystem, 0, 0);



-
pschat
 

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