Clean Project

Top  Previous  Next

 VBA 

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.

Remarks:

  • Do not clean a VBA project while a UserForm is running.
  • A backup file with the extension ".backup" is created in the same folder of the Office document (for example, "Book1.xlsm.backup") before starting the cleaning process. If the process is successful, that backup file is deleted. Otherwise, it is not deleted for you to restore it manually removing the extension ".backup".
  • 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 is deleted.