Compile option is...">

"Compilation Project" Not Available in Word 2010 VBA Editor

I have an MS Word template (.dot file), and sometimes the Debug-> Compile option is available, and sometimes not. What for? And why should I even compile my VBA?

+3
source share
1 answer

If you compile your project (or run Sub, which automatically compiles the project before starting), the compilation element disappears, since the project has already been compiled. Once you edit your VBA code, the Compile element will reappear in the Debug menu.

It looks a bit like the Save item in the File menu of some applications, for example. some text editors. If the file has not changed since the last save, the Save item is not available.

As for why you want to compile: this is a good way to check for compile-time errors, without actually running your code. If you just run it, it will be compiled, and then continue execution if there are no compilation errors. You might not want this to happen if, for example, your code sends email, modifies your document, deletes files, or something else.

+6
source

All Articles