AppsPro

Application Professionals

Established 1999

Contact Rob Bovey

The Excel VBA Code Cleaner

During the process of creating VBA programs a lot of junk code builds up in your files. If you don't clean your files periodically you will begin to experience strange problems caused by this extra baggage. Cleaning a project involves exporting the contents of all its VBComponents to text files, deleting the components and then importing the components back from the text files.

Code Cleaner Features

  • COM Add-In - The VBA Code Cleaner is now implemented as a COM add-in. This significantly improves the speed and stability of the program.
  • Export Code Files - This feature allows you to export all the code files from a project to the directory you specify without the need to perform a project cleaning.
  • Import Code Files - This feature allows you to import all code files from a specified directory into the project you select.
  • Automation - All features of the code cleaner are exposed to VBA through COM automation so you can create your own applications using the code cleaner as a component.

NOTE: The VBA Code Cleaner DOES NOT support 64-bit versions of Excel. It runs in all 32-bit versions of Excel on any version of Windows.

Installation and Operation

Before installing the Code Cleaner you must set your security to trust access to Visual Basic projects.

  • Excel 2010 and Later - Choose File > Options > Trust Center > Trust Center Settings > Macro Settings. Check the checkbox labeled Trust Access to Visual Basic Project and click OK twice to finish.
  • Excel 2007 - Choose Office Button > Excel Options > Trust Center > Trust Center Settings > Macro Settings. Check the checkbox labeled Trust Access to Visual Basic Project and click OK twice to finish.
  • Excel 2003 and Earlier - Choose Tools > Macro > Security from the Excel menu and click the Trusted Sources tab. At the bottom of this tab you'll see a checkbox labeled Trust Access to Visual Basic Project. Check this option and click OK.

The Code Cleaner creates a 'Clean Project' menu item below the Tools menu in the Visual Basic Editor. Click this menu item to run the code cleaner.

Download

Download the Excel VBA Code Cleaner (Version 5.0.32)