Error -2032465764 'Operation succeeded but no object returned'

D

Dieter Sternberg

Hi,

can someone please explain, why (and when) visio is throwing the error
-2032465764 (0x86db089c) : 'Operation succeeded but no object returned'?

I'am using in VBA the ActiveWindow.Selection to select some basic
shapes, mainly lines.
The selection will be combined and the resulting shape then grouped
along with other shapes.
If that group is dropped onto the same page, I get this error.
If it is dropped onto a stencil (it should become a master), the result
is an empty master without any error message.
As far as I can see, visio seems to be unable to replicate the shapes in
the group. But why?

The only info I've found is the following knowledgebase article:
http://support.microsoft.com/kb/946181/ja
Sadly it is only in japanese - and that's hard to read for me :)

Maybe someone has some extra info or can translate the main ideas of the
article to (readable) english since the automatic translation is of
little help here.

Thanks
Dieter
 
P

Paul Herber

Hi,

can someone please explain, why (and when) visio is throwing the error
-2032465764 (0x86db089c) : 'Operation succeeded but no object returned'?

I'am using in VBA the ActiveWindow.Selection to select some basic
shapes, mainly lines.
The selection will be combined and the resulting shape then grouped
along with other shapes.
If that group is dropped onto the same page, I get this error.
If it is dropped onto a stencil (it should become a master), the result
is an empty master without any error message.
As far as I can see, visio seems to be unable to replicate the shapes in
the group. But why?

The only info I've found is the following knowledgebase article:
http://support.microsoft.com/kb/946181/ja
Sadly it is only in japanese - and that's hard to read for me :)

Maybe someone has some extra info or can translate the main ideas of the
article to (readable) english since the automatic translation is of
little help here.

What code are you using to drop the selection on the page or stencil?
Are you expecting a selection or a shape object?
 
D

Dieter Sternberg

Paul said:
What code are you using to drop the selection on the page or stencil?
Are you expecting a selection or a shape object?

The Pseudocode is (simplified) like this:
Dim visShape As Visio.Shape
ActiveWindow.Selection.DeselectAll
For Each visShape in ActivePage.Shapes
If IsCombinable(visShape) Then
ActiveWindow.Selection.Select(visShape, visSelect)
Endif
Next
ActiveWindow.Selection.Combine
' All combinable shapes are now merged into one shape to reduce the
masters complexity

ActiveWindow.DeselectAll
ActiveWindow.SelectAll
' Group the combined shapes and the remaining shapes that are not part
of the former combine
ActiveWindow.Selection.Group

' Expect there is now only one top level shape
Debug.Assert ActivePage.Shapes.Count = 1
Set visShape = ActivePage.Shapes(1)
ActivePage.Drop(visShape,0#,0#) ' Throws error -2032465764

But I think I've found a workaround for the problem after playing with
the code for a while.
The shape to be combined are duplicated, the duplicates combined and the
original shapes deleted.
The loop is slightly modified like this
For Each visShape in ActivePage.Shapes
If IsCombinable(visShape) Then
Set visDummyShape = visShape.Duplicate
ActiveWindow.Selection.Select(visDummyShape, visSelect)
visShape.Delete
Endif
Next

With that code I've never seen the error again but still don't know what
the reason was.
Thinking this must be something with references (object variables) to
the combined shapes
still hanging around when the grouping takes place.

Dieter
 

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