VBA Macro Errors related to EXD Files

By | January 9, 2013

While deploying your VBA Macro on client’s environment or all of sudden during development you may experience either of the following errors with your VBA macro.

* Can’t find project or library
* Variable not defined
* Object library invalid

Possible cause for error: As a developer; try to verify if you have recently updated your system. Sometimes, windows update installs the newer version of certain Visual Basic 6.0 Runtime files. These updates install the files appropriately; however it creates discrepancies with EXD files.

When you use Active X controls provided by runtime files; EXD files are created.  After applying the updates; these EXD files becomes invalid with the newly updated runtime files resulting one of above mentioned errors.

Solution: To fix errors; the older EXD files should be deleted from the system. This is safe because after compiling the macro, system will automatically generate these files based on the newer run time files.

Steps for deleting EXD files:

1. Run the command prompt (For Windows7/Vista Run the command prompt as Administrator).
2. Enter the command to delete EXD files from machine “Del C:\*.EXD /s”

Detail information on above mentioned command: /S includes files in the specified directory shown at the prompt and all subdirectories, *.EXD includes all files with the EXD extension.

3. Exit the command prompt.
4. Finally compile the macro and see if it runs fine.