Clean Project

Top  Previous  Next


The Clean Project feature allows you to solve some strange problems that can happen in VBA projects because of junk created internally by the VBA compiler. To solve these problems the classes, modules and userforms must be exported as text files, removed from the project and imported back to the project. This feature automates this process.

MZ-Tools offers the following ways to clean the selected VBA project:

  • The File | Clean Project menu.
  • The Clean context menu in the Project Explorer.
  • The keyboard shortcut associated with the Clean Project feature.


  • Do not clean a VBA project while a UserForm is running.
  • A backup file with the extension ".MZToolsCleanBackup" is created in the same folder of the Office document (for example, "Book1.xlsm.MZToolsCleanBackup") before starting the cleaning process.
  • The files are exported to a folder named "MZToolsClean" inside the temporary folder (typically "C:\Users\<user>\AppData\Local\Temp"). If the process is successful, that folder and its files are deleted.