TheSwamp
Code Red => VB(A) => Topic started by: Bryco on February 13, 2007, 11:23:56 PM
-
I've finally had a little time to play with 2007 and once again there is reference problems.
The function below seems to work ok but I presume I'm going to get a perfermance hit.
Although I've written functions to set the correct reference before, I've never made a reliable one.
Does anyone have an early binding solution that works for 2006 and 2007?
Function SetAxdb() As Object
'Dim dbxDoc As New AxDbDocument
Dim dbxDoc As Object
Select Case AcadVer
Case 2000
Set dbxDoc = GetInterfaceObject("ObjectDBX.AxDbDocument")
Case 2002, 2004, 2005, 2006
Set dbxDoc = GetInterfaceObject("ObjectDBX.AxDbDocument.16")
Case 2007
Set dbxDoc = GetInterfaceObject("ObjectDBX.AxDbDocument.17")
End Select
Set SetAxdb = dbxDoc
End Function
-
Hello, Bryco :-)
I do not use late binding
here is a trick I use
Define ObjectDBX twice
Dim oDBX As AxDbDocument
Set oDBX = New AxDbDocument
Set oDBX = Application.GetInterfaceObject("ObjectDBX.AxDbDocument.16") '<--17 for A2006 and higher
I have A2005 only on my machine though
Hope that helps
~'J'~