add dinamically the Type Library

add dinamically the Type Library

Anonymous
Not applicable
552 Views
2 Replies
Message 1 of 3

add dinamically the Type Library

Anonymous
Not applicable

Dears,

 

Is it possible to dinamically configure the Type Library using VBA?

We have several versions installed and everytime a user with different Autocad version will run the VB code, he has to remember to change the Reference.

Some users may not know how to fix it. Is there a way to do it using VBA code?

 

Thank you

Type Library.jpg

 

 

 

Type Library.jpg

0 Likes
553 Views
2 Replies
Replies (2)
Message 2 of 3

Ed__Jobe
Mentor
Mentor

You can search this forum for using VBE. I've posted an example. However, you need to understand how the problem gets created. When you create a vba project, AutoCAD automatically adds a reference to the correct type library. When you open a vba project in a higher version of AutoCAD, the project automatically gets recompiled to the newer version. The only way to protect against this is to keep 2 copies of the dvb, one for the earlier version and one for the newer version. Set the appropriate tlb in each dvb. Then give the correct dvb to each user. Now you don't need to programmatically set references. If the user has multiple versions of AutCAD on the same pc, put the dvb's in separate folders and use Options to properly set the Support File Search Path.

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 3

Anonymous
Not applicable

Ok I understood, I guess it is not possible using Excel VBA. Right?

0 Likes