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
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 😉
Thank you Alfred, I did update the library to AutoCAD 2013 type library. Here are all the libraries I been using.
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.
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.....
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 -
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.
Can't find what you're looking for? Ask the community or share your knowledge.