Error:Inappropriate source object for this action. while droping s

J

Jeeban

When i want to drop a stensil in to the visio then this error message message
will come.
i checked all, the path is correct . this is only happend in this stensill.
it is working fine with other stensill.

can any body give sugession.?
Thanxs.
 
P

Paul Herber

When i want to drop a stensil in to the visio then this error message message
will come.
i checked all, the path is correct . this is only happend in this stensill.
it is working fine with other stensill.

can any body give sugession.?
Thanxs.

Which stencil?
Which shape from that stencil?
 
J

Jeeban

Paul Herber said:
Which stencil?
Which shape from that stencil?


Actually sir,
i have created two stensil with one shapes each .
one shape of a stensil is droping finely, but other shape of 2nd stensil is
not drop. while drop it is giving error... Inapporpriate source object.

my code is

try
Set oshape = oActiveWindow.Page.Drop(oStencilDoc.Masters.ItemU(1),
mvarInsertPointX, mvarInsertPointY)

catch(ex as exception)
msgbox (ex.message)

end try

in (oStencilDoc.Masters.ItemU(1), the shape is available and point is also
available. i couldnt understand why it is giving like that error..?
 
J

JuneTheSecond

Hi Jeeban,

You have two different stencils.
Please make sure that you defined
"oStencilDoc" for each different stencil.

This is my test code in VBA.
Sub test()
Dim doc As Visio.Document
For Each doc In Application.Documents
If doc Is ActiveDocument Then
Debug.Print doc.Name
Else
Debug.Print doc.Name
ActivePage.Drop doc.Masters(1), 0, 0
End If
Next
End Sub
 
J

Jeeban

JuneTheSecond said:
Hi Jeeban,

You have two different stencils.
Please make sure that you defined
"oStencilDoc" for each different stencil.

This is my test code in VBA.
Sub test()
Dim doc As Visio.Document
For Each doc In Application.Documents
If doc Is ActiveDocument Then
Debug.Print doc.Name
Else
Debug.Print doc.Name
ActivePage.Drop doc.Masters(1), 0, 0
End If
Next
End Sub
--
JuneTheSecond

Now, visual calculation is more visual.
http://www.geocities.jp/visualcalculation/english/index.html




no sir....
my code is working with other stencil fine ....
but only one stencil , it is creating problem.

all stencill are own made. . all stencilDocs are defined properly.

at a time i have to drop one symbols.. i have tested for 100 case. all r
fine but only one stencill causes error...
Inappropriate source for this action.

what could be the problem

Set oStencilDoc = mvarVisioApplication.Documents.OpenEx(StencilFilePath,
visOpenDontList + visOpenHidden + visOpenDocked)
' oStencilDoc = oVsApp.Documents.OpenEx(StencilPath,
VisOpenSaveArgs.visOpenDontList + VisOpenSaveArgs.visOpenHidden +
VisOpenSaveArgs.visOpenDocked) ' CShort(VisOpenSaveArgs.visOpenDontList))

Set oshape = oActiveWindow.Page.Drop(oStencilDoc.Masters(1),
mvarInsertPointX, mvarInsertPointY)

If Err <> 0 Then
MsgBox Err.Description & "Unable to Insert"
oStencilDoc.Close
oActiveWindow.WindowState = visWSMaximized
Exit Function
Err.Clear
End If
Is there any problem of the sshape or that stencill..
i think my code is fine, beacuse for other stencil it is fine...
 
P

Paul Herber

Actually sir,
i have created two stensil with one shapes each .
one shape of a stensil is droping finely, but other shape of 2nd stensil is
not drop. while drop it is giving error... Inapporpriate source object.

Something within the shape in the stencil is probably referencing a
shape that now doesn't exist. Have a look through all the formulae in
the master and see if one or more formulae refer to another shape.
 

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