This is a symptom specifically when compiling an Excel VBA project. The following error occurs:
User-defined type not defin
I've seen this error too when the code stopped at the line:
Dim myNode As MSXML2.IXMLDOMNode
I found out that I had to add "Microsoft XML, v6.0" via Tools > Preferences.
Then it worked for me.