How much slower is Excel VBA compared to Visual Basic .net?

S

Sing

Dear Excel Gurus,

After adding several features, my worksheet running Excel VBA has become
very slow. I am thinking of migrating the VBA application to Visual Basic
..Net

I have 2 questions;
1. For an estimate, how much faster is Visual Basic .net as compared to
Excel VBA?
2. How different is the code syntax of Visual Basic .net as compared to
Excel VBA?

Thank you.
 
B

Bob Phillips

VB.Net will be intrinsically faster because it is compiled. But conversely,
it adds an another layer to be dealt with by the code. And maybe most
significantly, it is a different development paradigm, so the learning curve
is not insignificant.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
C

Charles Williams

VB.net with Excel is probably slower than VBA with Excel because of the
extra interop layers it has to go through.

The syntax is sufficiently different that converting the code is a
significant rewrite.

I would recommend looking at the usual slow VBA reasons before migrating:

Application.screenupdating=false
application.calculation=xlmanual

Read data from a range into a variant containing an array as a block of
cells rather than cell-by-cell

Process the data using arrays

Write the data back to a range as a block of cells from the array

Application.screenupdating=true
application.calculation=xlautomatic

Charles
_________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html
 

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

Top