VBA -vs- VB

  • Thread starter Thread starter Bill Martin
  • Start date Start date
B

Bill Martin

Does someone have a feel for the relative speeds of VBA -vs- Visual Basic?
For a computationally intensive application say for simplicity. Calculating
the nth digit or pi or whatever?

It's not clear to me what "compiled" means anymore. People refer to VBA
being compiled, but I've never felt comfortable whether it is really fully
compiled down to optimized executable code (like C say), or whether it's
actually tokenized -- something between interpreted and compiled. And I
know even less about Visual Basic.

Thanks.

Bill
 
VBA is tokenized. I don't know about a VB EXE or DLL. But why compare
Excel VBA to standalone VB? You should be comparing Excel to standalone VB.
Excel can do calculation far faster than VBA.
 
The reason for that sort of comparison is that I have moderately large
spreadsheets where I use VBA to do a lot of repetitive Monte Carlo
optimization. At times I've been tempted to port it out to C code, but I
never personally liked C and never been motivated enough to actually do it
anyhow.

I was just curious if VB would give fully compiled performance, and yet be a
higher level language than C to program in. Presumably various bits of VBA
code could be ported more easily into VB than into C?

The easy solution would be to just get a much faster computer, but...

Bill
------------------------------
 
If you take your VBA code and put it in a VB6 ActiveX dll and use that dll
you may get some increased speed but not that much. I found it in the order
of 50% to 100% increase, depending of course what the VBA code is.
Usually there is more gain if you optimize your VBA code.
Still, moving to a VB ActiveX dll is very easy and you have the added bonus
of good code protection if you needed that.

RBS
 
Thanks for the info.

Bill
--------------------
RB Smissaert said:
If you take your VBA code and put it in a VB6 ActiveX dll and use that dll
you may get some increased speed but not that much. I found it in the
order of 50% to 100% increase, depending of course what the VBA code is.
Usually there is more gain if you optimize your VBA code.
Still, moving to a VB ActiveX dll is very easy and you have the added
bonus of good code protection if you needed that.

RBS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top