Add or remove a project reference
xlide_manage_referenceAdd or remove VBA type library references to resolve missing-library errors and enable early binding in Office files.
Instructions
Adds or removes a type library reference in a VBA project and saves the file. Use it when xlide_analyze reports missing-library-reference, or when code needs early binding, as Dim d As Scripting.Dictionary does. Name the library: Excel, Word, PowerPoint and Access work anywhere, and on Windows any library the VBA editor's References dialog lists resolves by its description (Microsoft Scripting Runtime) or by the name code writes (Scripting), taking its GUID, version and path from this machine's registry. A name that matches several libraries is refused with the candidates. Off Windows, pass guid and version. Adding the host's own library, or removing Microsoft Forms while a UserForm exists, is refused: the first is implicit and the second stops the project compiling.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guid | No | For add: the library's GUID, when it is not registered on this machine. library is then the name the reference is recorded under. | |
| action | Yes | 'add' or 'remove'. | |
| library | Yes | For add: the library's description, the name code uses, or Excel, Word, PowerPoint or Access. For remove: the name xlide_list_references reports, or the GUID. | |
| version | No | For add with guid: major.minor in hexadecimal, as the registry spells it, such as 1.0 or 2.8. Empty takes the newest registered, or 1.0. | |
| file_path | Yes | Absolute path to the Office file. | |
| allow_protected | No | Ask the user first. | |
| allow_invalidate_signature | No | Ask the user first. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||