.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Invalid Execution Context again

1 REPLY 1
SOLVED
Reply
Message 1 of 2
GeeHaa
922 Views, 1 Reply

Invalid Execution Context again

Hi

 

I am recieving the message invalid execution context when I try to open a drawing. The form that this button is on was opened modeless.

any help would be much appreciated.

 

 Private Sub BTN_Select_Attribute_Tag_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTN_Select_Attribute_Tag.Click
        OpenFileDialog1.Filter = "AutoCAD Drawings|*.dwg"
        OpenFileDialog1.Multiselect = False
        Dim dialogRes As DialogResult = OpenFileDialog1.ShowDialog()

        If dialogRes = Forms.DialogResult.OK Then
            Dim dwgName As String = OpenFileDialog1.FileName

            Dim acDoc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(dwgName, True)

 

1 REPLY 1
Message 2 of 2
GeeHaa
in reply to: GeeHaa

I think I figured it out.

 

If I dispose of Openfiledialog1 it opens the drawing without an error.

 

Thanks Again.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost