Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

vba code won't work on 2013 autocad X64 system

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
2261 Views, 7 Replies

vba code won't work on 2013 autocad X64 system

I am upgrading the AutoCAD 2009 X 32 systems to the 2013 X64, and I have this vab code that won't work on the new system.

I try to move the search path that contain the file up to the top and also got all the missing libraries, but the code still won't work.

When I run the code it will give me error message like: compile error:

Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic.

 The code work perfectly without any error on the old system so I sure the code is causing this error.

I am running out of idea can somebody help me with this?

Thank you

7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

sorry I mean The code work perfectly without any error on the old system ,so I sure the code is NOT causing this error.
Message 3 of 8
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

welcome @forums.autodesk.com !

 

When VBA stops with an compile-error it should show you the position of the line that is the source of the problem, doesn't it show the line in the VBAIDE?

The most principle thing: have you updated the references so the lib for AutoCAD 2013 (19.0) is used?

 

- alfred -

PS: there is a special forum for VBA customization >>>here<<<, just for the next question 😉

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 4 of 8
Anonymous
in reply to: Alfred.NESWADBA

Thank you Alfred, I did update the library to AutoCAD 2013 type library. Here are all the libraries I been using.

Capture.PNG

I am new to VBA, so I am not too good of understanding what is going on in there. The errors are not consistent, sometime are in this line and sometime are in another line, and sometime compile error and sometime run-time error which never occurs in the past. This makes it even harder for me to track the errors. I'm not sure if that is because AutoCAD is no longer supporting vba and cause all this wired things to happen. I notice that the code were running really slowly and quit often freeze the program after the first run.

Message 5 of 8
Anonymous
in reply to: Anonymous

I mean "I'm not sure if that is because AutoCAD is no longer supporting vba and cause all this weird things to happen."

weird not wierd sorry for my poor spelling.....

 

 

 

Message 6 of 8
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

according to your screenshot I see

- that you have referenced something with Map2005 ==> that is definitly invalid

- I can't see if AxDbLib points to a 2013-lib

- I see that you use the ActiveX-control named "AutoCAD Focus Control for ...", if my remembering is correct then this is not compatible with 64bit .. but I'm not sure about that so please use that as search phrase and google around that.

 

>> I'm not sure if that is because AutoCAD is no longer supporting vba

The problem is not that AutoCAD can use VBA, the problem is more that Microsoft has no 64bit version of VBA6 and Autodesk made a workaround that has some sticking points, not only the speed of VBA-apps that brake down. With 2014 it's better as AutoCAD uses VBA7 and so has a real 64bit plugin (but also problems with ActiveX-controls there).

 

>> I am new to VBA, so I am not too good of understanding what is going on in there

To be honest, starting learning any programming language by debuging an application anyone else wrote is the hardest way to go. I would suggest to either start first with some VBA beginner lessons (maybe looking more to VB.NET) or try to get someone who understands the code and can help you.

 

Good luck, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 7 of 8
Anonymous
in reply to: Alfred.NESWADBA

Thank you again Alfred. I'll do some more digging into it. Currently I am the only one that is doing codeing, so there not much of choose for me. sigh.

Message 8 of 8
Anonymous
in reply to: Anonymous

****! I can't spell at all! anyway again wrong spelling, I am the only one that is doing coding, so there are not much of choice for me.

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

Post to forums  

State of Sustainability Webinar


AutoCAD Inside the Factory