VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBA Error 2014

1 REPLY 1
Reply
Message 1 of 2
kiji069
274 Views, 1 Reply

VBA Error 2014

Hi,

 

We have change the version of Civil 3D from 2010 to 2014.

 

With 2010, i have not any problems, but when i try with 2014, i have the following error : "Incompability of type" at the line

Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)

 

 

 

Here is my code :

 

Public Function GetBaseCivilObjects() As Boolean
    Dim oApp As AcadApplication
    Set oApp = ThisDrawing.Application

    ' 2010 => 7.0 / 2014 => 10.3
    Const sAppName = "AeccXUiLand.AeccApplication.10.3"
    Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
    
    If g_oCivilApp Is Nothing Then
        MsgBox "Error creating " & sAppName & ", exit."
        GetBaseCivilObjects = False
        Exit Function
    End If
    Set g_oDocument = g_oCivilApp.ActiveDocument
    Set g_oAeccDatabase = g_oDocument.Database

    GetBaseCivilObjects = True
End Function

 

 

Thanks for helping me..

 

Regards,

KiJi

1 REPLY 1
Message 2 of 2
Alfred.NESWADBA
in reply to: kiji069

Hi,

 

have you updated the references for AutoCAD and for the Civil3D lib also to 2014?

If yes, can you create a new VBA project with just that one sub .... and when that also fails upload the DVB file so we can see all declarations and settings.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)

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

Post to forums  

Autodesk Design & Make Report

”Boost