This is a symptom specifically when compiling an Excel VBA project. The following error occurs:
User-defined type not defin
An different problem with the same symptom: I had a class implemented which was not defined. It was wrapped with a #if that I thought should have not allowed the compiler to see it, but not so. Remove the comment out the Implements statement and all is well. I assume importing the definition would also work...