Protecting VBA Code

Protecting VBA Code

Anonymous
Not applicable
184 Views
3 Replies
Message 1 of 4

Protecting VBA Code

Anonymous
Not applicable
Does anyone have any thoughts on protecting your visual basic code
which you would like to distribute to customers?
I have been developing a bunch of customization and localization
routines for LDD in VBA.

I am planning on using some type of code cross referenced in the
registry for licensing.

I have added a password on the original source code.

My question is how reasonable a method is this?

Does the password source code protection have any back doors or bugs
(could an unhandled runtime error for example

accidentally reveal code?)

My other option is to compile and go with standard vb but from what
I've been lead to believe it would be much slower

executing because it is out of the acad process. As well I think that
there are more coordination problems when trying to

work in acad. If this is untrue please feel free to clarify.

Thanks,
Natan Elsberg
0 Likes
185 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Well, if your concern is about speed, you can write an
ActiveX dll in VB a call it from VBA. A dll is loaded in
process, so it is as fast as VBA... well, depending on
the kind of computation you do, it may be even faster (if
you have some routines that don't call Autocad objects
and produce heavy CPU load, but in fact that's not much
common when you work on customization). You can just make
available a public method in which you pass the current drawing,
or the application object to the dll, and then the dll could
be developed just as a standard VB program. I think this
solves both performance and protection problems.
Good work.
Andrea

Natan Elsberg wrote:
>
> Does anyone have any thoughts on protecting your visual basic code
> which you would like to distribute to customers?
> I have been developing a bunch of customization and localization
> routines for LDD in VBA.
>
> I am planning on using some type of code cross referenced in the
> registry for licensing.
>
> I have added a password on the original source code.
>
> My question is how reasonable a method is this?
>
> Does the password source code protection have any back doors or bugs
> (could an unhandled runtime error for example
>
> accidentally reveal code?)
>
> My other option is to compile and go with standard vb but from what
> I've been lead to believe it would be much slower
>
> executing because it is out of the acad process. As well I think that
> there are more coordination problems when trying to
>
> work in acad. If this is untrue please feel free to clarify.
>
> Thanks,
> Natan Elsberg
0 Likes
Message 3 of 4

Anonymous
Not applicable
As far as the password part of the question, it's not a reasonable method.
In house, it's fine if you want to keep your users from seeing your code
in the event of a runtime error, ect. But it's not secure. Go with the
dll.
-Josh

Natan Elsberg wrote:

> Does anyone have any thoughts on protecting your visual basic code
> which you would like to distribute to customers?
> I have been developing a bunch of customization and localization
> routines for LDD in VBA.
>
> I am planning on using some type of code cross referenced in the
> registry for licensing.
>
> I have added a password on the original source code.
>
> My question is how reasonable a method is this?
>
> Does the password source code protection have any back doors or bugs
> (could an unhandled runtime error for example
>
> accidentally reveal code?)
>
> My other option is to compile and go with standard vb but from what
> I've been lead to believe it would be much slower
>
> executing because it is out of the acad process. As well I think that
> there are more coordination problems when trying to
>
> work in acad. If this is untrue please feel free to clarify.
>
> Thanks,
> Natan Elsberg
0 Likes
Message 4 of 4

Anonymous
Not applicable
I read somewhere that it is possible to protect AutoCAD VBA code with
a password, but I can't remember where I read it and I also can't
figure out how to do it. I'm looking to create something like a
Microsoft Access MDE file where the code is hidden from users. Do I
have to switch to VB to be able to do this?

Ian Thomson
0 Likes