"Name conflicts with existing module, project, or object library" error when adding VBA Reference

  • 7023383
  • 26-Sep-2018
  • 02-Oct-2018

Environment

Reflection Desktop (including Pro, for IBM, or for UNIX and OpenVMS) 16.1 SP1 U1 HF7 (build 426) or higher

Situation

"Name conflicts with existing module, project, or object library" error when clicking the OK button in the VBA Reference dialog.  This error will only occur if you add more than one VBA Reference and the Host session files (RD3X, RD5X, RDOX) were created with a version of Reflection Desktop prior to Reflection Desktop 16.1 SP1 U1 HF7 (build 426). 

Resolution

Open the host session files (such as host.rd3x) in Reflection Desktop 16.1 SP1 U1 HF7 (build 426) or higher and change the name in the Visual Basic editor from Project(host.rd3x) and ProjectLegacy(host.rd3x) to host(host.rd3x) and hostLegacy(host.rd3x) respectively to make the Project names unique.

                or

Recreate the Host sessions being referenced in the latest version of Reflection Desktop that supports the Shared Macro functionality (Reflection Desktop 16.1 SP1 U1 HF7 (build 426) or higher), which will automatically create the uniquely named Projects in the VBA Editor.

Cause

The error occurs because all Project names in the earlier versions of Reflection Desktop used the same name of "Project" and "ProjectLegacy" in the VBA Editor.   To use the Shared Macros feature added to Reflection Desktop 16.1 SP1 U1 HF7 (build 426) or higher, the Project names must be unique and this later version of Reflection Desktop will automatically create unique names for newly created Host sessions.

Additional Information

Steps to duplicate:

1. Install Reflection Desktop 16.1
    Install Reflection Desktop 16.1 SP1

2. Create a host session called test2.rd3x and record and save a simple Reflection macro in the session.
    Close the host session and Reflection Workspace.

3. Create a host session called test3.rd3x and record and save a simple Reflection macro in the session.
    Close the host session and Reflection Workspace.

4. Install Reflection Desktop 16.1 SP1 U1 HF7 (Build 426) or higher.

5. Create a host session called test1.rd3x and set a VBA reference to both test2.rd3x and test3.rd3x.

6. Press OK.

7. Error occurs:

        Failed to reference the following:
        C:\Users\<username>\Documents\Micro Focus\Reflection\test3.rd3x
        Name conflicts with existing module, project, or object library.

Workaround for this particular situation:

Open test2.rd3x and test3.rd3x in Reflection Desktop 16.1 SP1 U1 HF7 (build 426) or higher and change the name in the Visual Basic editor from Project(test2.rd3x) and Project(test3.rd3x) to test2(test2.rd3x) and test3(test3.rd3x) respectively to make the Project names unique.  For consistency, also rename the ProjectLegacy(test2.rd3x) and ProjectLegacy(test3.rd3x) to test2Legacy(test2.rd3x) and test3Legacy(test3.rd3x) respectively.