Monday, October 29, 2007

EXD Menace

I had created a Activex Control to be used in a Excel VBA application and each time I compile a new version, I was running into trouble as Excel would give me errors like "Element Not Found" or "Object Library invalid..".

After scratching my head for long and some googling, I found that .exd files are the root of this menace. Once I deleted them, my controls started behaving as desired.

So what is this .exd files ?
Exd files store cached information about a control is been inserted into an Microsoft Office document or VBA macros, allowing the additionals controls to be added in lesser time.

The first time you insert a control into a document or UserForm, the Office program creates an .exd file for that control in the temp folder. After a program creates the .exd file for a specific control, it takes less time to insert the same control again. This is because the .exd file caches information for the control.

The program that creates the .exd files does not delete them when you quit the program. The next time you start the same program and insert the same control, the .exd files are still available for the program to use.

If you delete any of the folders listed above, or any of the .exd files they contain, you do not receive any error messages, and no problems occur. However, you may notice a slight decrease in performance the first time you insert a control because the .exd file for that control does not exist. After the program recreates the .exd file, you can reinsert the control with improved performance.

So next time you run into such a problem after recompiling your control, remember to delete the exd file and that would solve your problem.