Meaning of error
The following error message occurs when VBA detects object declarations of unknown type. The compiler is unable to locate the references needed to instantiate the object type.
Solution
Relocate the references for the type that is missing. In the VBA window, locate Tools -> References…
In the References window, locate all references that is used in your VBA program. Typically for a SolidWorks Macro, it is necessary to select the SldWorks type library as well as the constant, command and utility type libraries. Other references may be required depending on the application.