Is there something I'm missing between 2005 and 2006? I've got a batch
processor that checks to see if an acad session is running and if so open a
document in that session and if its not running, open AutoCAD and then open
a document. The simple code works fine in AutoCAD 2005, but not with 2006.
This is my sub for detecting the acad session:
Imports Autodesk.AutoCAD.Interop.Common
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.AcadPlotClass
Sub DetectAcadSession()
blnAcadExist = False
' Check to see if Acad is open
On Error Resume Next
acad = GetObject(, "autocad.application") 'try to get the app object
If Err().Number <> 0 Then 'if not then create a new
one
blnAcadExist = False
acad = New AcadApplication
Else
blnAcadExist = True
End If
Err().Clear()
ACADVer = acad.Version.ToString() 'save acad version for later
End Sub
This is the code I use to Open a document:
dwg = acad.Documents.Open(strDwgs(i), False) 'strDwgs(i) is valid
If I step through the code using AutoCAD 2006, it works. If I just run it,
I get "Call Rejected by Callee".
Any help or tips would be greatly appreciated!