Thanks Jonathan. So is there no change in execution speed? I assume
that a DLL is compiled, whereas VBA is interpreted, but maybe I'm
wrong here.
Jay
> The VBA project password is easily broken if you have the right tools. If
> you have proprietary code you want to protect, it is better to move it to a
> DLL so that the source code is not included in the package sent to the
> customer.
> Thanks Jonathan. So is there no change in execution speed? I assume
> that a DLL is compiled, whereas VBA is interpreted, but maybe I'm
> wrong here.
Both are compiled after a fashion. The old distinction between interpreted
and compiled is much muddier than when the terms were distinct about 30
years ago. The key issue with regard to performance is the speed of access
to objects, and that is a much more difficult thing to provide hard & fast
rules for.
All I can say is that when a VB6 ActiveX DLL is compiled and uses early
binding back into the Word object model, I have found execution speeds to be
broadly comparable for my own code. I have not attempted to use VB.NET or C#
for this purpose, so I cannot say whether the same is true for an ActiveX
DLL compiled in a .NET language.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Jay - 17 Oct 2005 12:00 GMT
Thanks, I now understand.
Jay
> > Thanks Jonathan. So is there no change in execution speed? I assume
> > that a DLL is compiled, whereas VBA is interpreted, but maybe I'm
[quoted text clipped - 11 lines]
> for this purpose, so I cannot say whether the same is true for an ActiveX
> DLL compiled in a .NET language.
Karl E. Peterson - 17 Oct 2005 21:56 GMT
>> Thanks Jonathan. So is there no change in execution speed? I assume
>> that a DLL is compiled, whereas VBA is interpreted, but maybe I'm
[quoted text clipped - 11 lines]
> to use VB.NET or C# for this purpose, so I cannot say whether the
> same is true for an ActiveX DLL compiled in a .NET language.
Jay, I would definitely agree with Jonathan's assessment in cases where most of the
code is object model manipulation. However, if you're doing intense processing
(outside the application's object model) of some sort or another, such as encrypting
multi-megabyte files, you absolutely can achieve quite noticable performance
enhancements with fully-optimized, native compilation. I've seen several orders of
magnitude benefits in certain circumstances, amounting to 2-hour processing times
being reduced to mere minutes, for example. (Now, whether my experiences are
"normal" -- well, that's an entirely different question! <g>)
Later... Karl

Signature
Working Without a .NET?
http://classicvb.org/petition