open shape data window from VBA

S

Scott

I would like to open the shape data window for a selected object from VBA.
The code below opens the diaglog quite nicely, and if I change any data value
and click OK, all is well. However, if the dialog opens and I do not change
any data values but click either OK or Cancel, VBA reports: Run-Time error
'-2032466955 (86db03f5)'

Any idea why this happens or how to prevent it?
= = = = = = = = = = = = = =
Sub OpenShapeData()

Dim shpCurrent As Visio.Shape

Set shpCurrent = ActiveWindow.Selection.Item(1)
shpCurrent.Application.DoCmd (1312)

End Sub
 
J

JuneTheSecond

Here was another same question about a month.
Trap error with On Error or neglect error with On Error Resume Next.
 
S

Scott

On Error Resume Next solved the problem -- thanks.

Any idea why not changing any data values causes an error in the first place??
 
J

JuneTheSecond

Visio DoCmds have no return value to show the job is done or not.
If they have return code, we can write proper code as If DoCMD(XXX) = OK
then, unfortunately we are force to use error trap.
 

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