Author Topic: Object is currently in use elsewhere  (Read 1477 times)

0 Members and 1 Guest are viewing this topic.

ANDYSMI

  • Guest
Object is currently in use elsewhere
« on: January 24, 2013, 12:52:06 PM »
Hi forum
I've got a vb.net app I'm working on and the thing seems to work alright except after it runs and I close AutoCAD I get a message in VS that says InvalidOperationException was unhandled
Object is currently in use elsewhere
The program is a windows form opening another windows form
Code: [Select]
Dim ofrom As frmAdd = New frmAdd
            ofrom.Show()
            ofrom = Nothing
            Me.Hide()
            Me.Dispose()

ANDYSMI

  • Guest
Re: Object is currently in use elsewhere
« Reply #1 on: January 24, 2013, 02:30:41 PM »
I think I cured my own problem. While I was testing I have Visual Studio set up to start AutoCAD as the start action to debug. After I'd try my code out, I would simply just close Autocad to kill the application and return to Visual Studio. Apparently windows didn't like this. When I started to actually close my application and then close Autocad, the problem went away.