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

Cannot Get or Create AutoCAD App

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
meck
519 Views, 8 Replies

Cannot Get or Create AutoCAD App

I have upgraded to AutoCAD 2015 and now I cannot get the app anymore. I'm getting the "Cannot Connect to ActiveX component" error. I assume it has something to do with versioning and I tried using AutoCAD.Application.19 but that doesn't work either. Is this the problem? If so how do I get the version? I looked in the Help/About but couldn't find anything.

Any help would be greatly appreciated!

 

I'm using VB.net 2010.

 

Below is my connection code...

 

 

Try
      oAcadApp = GetObject(, "AutoCAD.Application")
Catch
     Try
          oAcadApp = CreateObject("AutoCAD.Application")
          oAcadApp.Visible = True
     Catch ex As Exception
          MsgBox(ex.Message & " error while starting AutoCAD.", MsgBoxStyle.Exclamation, "Error Starting AutoCAD!")
          Exit Sub
     End Try
End Try

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
8 REPLIES 8
Message 2 of 9
Ed.Jobe
in reply to: meck

Are  you creating a standalone exe? Is it 32bit and your acad 2015 is 64bit?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 3 of 9
meck
in reply to: Ed.Jobe

Yes it is a stand alone exe.

AutoCAD is 64 bit.

All running on Windows 7.

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
Message 4 of 9
Ed.Jobe
in reply to: meck

On your project properties, build tab, what is the platform target set to? Can you set it to x64?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 5 of 9
meck
in reply to: Ed.Jobe

No it will not let me set it to x64 only x86

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
Message 6 of 9
Ed.Jobe
in reply to: meck

Not sure why you can't change it. Maybe its because you have references to 32 bit apps?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 7 of 9
meck
in reply to: Ed.Jobe

I figured it out and was able to get it to change to X64, but now I have errors everywhere. All of these to start with...

Imports Autodesk.Connectivity.WebServices

Imports Autodesk.Connectivity.WebServicesTools

Imports Autodesk.Connectivity.Explorer.ExtensibilityTools

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
Message 8 of 9
meck
in reply to: meck

I got it to work!

I had to bump the framework up to 4.5 and then everything came back into focus.

I would never have been able to do this without your help!

Much appreciated!

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
Message 9 of 9
Ed.Jobe
in reply to: meck

Glad you got it to work.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

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

Post to forums  

Autodesk Design & Make Report

”Boost