Message 1 of 7

Not applicable
04-19-2016
02:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having some issues with some code I developed in an excel workbook. I open autocad and run a macro based for a certain filename. It works perfectly on my machine which is running Autocad 2014 but when I go run it on another computer which has Autocad 2016 I get the error 429 ActiveX can't create object. I don't have any references in VBA to autocad libraries or anything.
Public Function RUNproject(ByVal ProjectPath As String, ByVal MacroName As String, ByVal ACADDocName As String) On Error GoTo newACAD Set ObjACAD = GetObject(, "AutoCAD.Application") newACAD: If ObjACAD Is Nothing Then Set ObjACAD = CreateObject("AutoCAD.Application") ObjACAD.Visible = True ObjACAD.WindowState = 2 End If ObjACAD.Documents.Open (ACADDocName) Set ThisDrawing = ObjACAD.ActiveDocument Dim FileName As String FileName = ProjectPath ' Load a sample VBA project DVB file create with AutoCAD ObjACAD.LoadDVB FileName ' Run the macro ObjACAD.runmacro MacroName 'enter the module and routine/function name ThisDrawing.Close 'objAcad.Documents.Close Exit_Here: Exit Function Err_Control: MsgBox Err.Description Resume Exit_Here End Function
Solved! Go to Solution.