This is a symptom specifically when compiling an Excel VBA project. The following error occurs:
User-defined type not defin
When I had this error in a MS Access database I used the /decompile command line switch along with the Compact/Repair option. Worked for me. I had removed a reference that I was sure my code no longer used and started getting this error.