Forum Discussion
rodsan724
Oct 29, 2021Brass Contributor
What does Compile VBA Project do anyway
There is an option in my Excel 2016 VBA project that says Compile VBA Project. What does this do?
HansVogelaar
Oct 29, 2021MVP
It does two things:
- It checks whether the code in the workbook is syntactically correct. If it finds an error, it will display an error message and highlight the problematic line. This is very useful, in particular before distributing a workbook to others.
- It stores the VBA code in a tokenized form that executes more efficiently than interpreting the text line by line. The VBE will also do this when you run a macro, but then for that macro only. Debug > Compile <projectname> will do it for all code in the workbook at once.
- rodsan724Oct 29, 2021Brass ContributorDoes it create a new file or just stuff internally?
- HansVogelaarOct 29, 2021MVP
The tokenized code is stored in the workbook itself.