Excel vba 'compile vba' in debug toolbar?
Excel vba 'compile vba' in debug toolbar?
(OP)
I can't find anything in Excel help that explains to me exactly what this action does and what the results are of this action relative to my code running speed. Can anyone pls help?





RE: Excel vba 'compile vba' in debug toolbar?
Cheers,
Joerd
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Excel vba 'compile vba' in debug toolbar?
That being said, the compiler has other benefits as well. It will insure that all referenced controls are within their scope, that procedures are properly names, parameter lists match argument lists both in type and count, that If-Then-Else statements are blanaced, loops are not interlaced, and many many other structural, syntactic, and to a limited degree, semantic mistakes are not being made in the code. If you, and I highly recommend this, use Option Explicit at the top of the VBA modules, then the compiler will insure that every variable is properly declared, which greatly aids in finding a bug caused by a typo in a variable name.
Compiling should be an integral part of the code development process. It can identify many error in the code, but not all. Some will only be discovered at run-time.