What's the point of compiling?

C

cdb

In the Debug option of the VBA window there's an option to compile the
project. What exactly does this do and what's the point in it?
 
B

Bernie Deitrick

Compiling the project checks that the syntax is correct and that the
variables are correctly typed in (that is, if you used Option Explicit,
which you always should.) Sort of checking for errors prior to running the
macro.

HTH,
Bernie
MS Excel MVP
 
C

cdb

So should you compile after every change you make to check it's not incorrect
anywhere?
 
B

Bernie Deitrick

It depends on how much you've changed your code and how critical the
application is. Also remember that it doesn't test your code to make sure
that it actually does what you want - no compiler can do that. All it does
is make sure your have your Next's and End if's and all that...

HTH,
Bernie
MS Excel MVP
 
C

cdb

OK, will bear this in mind.

Cheers

Bernie Deitrick said:
It depends on how much you've changed your code and how critical the
application is. Also remember that it doesn't test your code to make sure
that it actually does what you want - no compiler can do that. All it does
is make sure your have your Next's and End if's and all that...

HTH,
Bernie
MS Excel MVP
 

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