RDC01007: Host library not referenced
Severity: Error · Family: RDC (Rubberduck Core analyzers) ·
Raised by: DocumentModuleHostAnalyzer
A module is the code of a document of a host RD-VBA knows - an Excel worksheet, say - and the project does not reference the host's library. The members of
the document's class are then no names of the module's code: Range and Me.Range in a worksheet's code name nothing, and are reported as such.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
| A document module whose host's library is not among the project's references. | "Super": "ExcelWorksheet", and no reference to Excel |
Add the reference to the .rdproj: "References": [ { "Name": "Excel" } ]. |
Quick fix
The diagnostic comes with a quick fix, Reference the … library (Reference the Excel library), which adds the reference to the .rdproj and loads the
workspace again. The reference comes after the project's references: an earlier reference has the higher precedence, so a name that one of them declares too
keeps meaning theirs. It names the library's type library by its Guid and version. The fix is offered only for a library RDCore has a description of.
Notes
With the reference, the module's code binds, and the module is reported as code that presumes its host: RDC01005 Hosted document code explains how to move it.
See also
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca