unhandled exception when using DoCmd

R

Ryo_Ohki2

I get this error when I use the DoCmd and press cancel..
ie:
{VisioDrawingCtrl}.Window.Application.DoCmd(Microsoft.Office.Interop.Visio.VisUICmds.visCmdLayerSetupDlg)

When I click OK (without modifying anything) or click Cancel, I ge
this error.
--------
An unhandled exception of typ
'System.Runtime.InteropServices.COMException' occurred in MainGUI.exe
Additional information: Cancel.
--------
I did try using the following, but then my cursor would be stuck o
hourglass when over the drawing.
Try
{VisioDrawingCtrl}.Window.Application.DoCmd(Microsoft.Office.Interop.Visio.VisUICmds.visCmdLayerSetupDlg)
Catch ex As Exception
End Try

Any one have any ideas how to stop it from happening
 
R

Ryo_Ohki2

Well I figure a way to get around that problem.. not exactly elliquent
but it would work. I just basically resized the visio window an
resized it back to normal.
ie
vVisioDrawingCtrl.Window.Zoom
vVisioDrawingCtrl.Window.Zoom + 1
vVisioDrawingCtrl.Window.Zoom
vVisioDrawingCtrl.Window.Zoom - 1
This of course is used in conjuntion with the Try/Catch
 

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