XL97 Err Msg: "Name Conflicts with Existing Module"

ID: Q156882


The information in this article applies to:
  • Microsoft Excel 97 for Windows


SYMPTOMS

In the Visual Basic Editor in Microsoft Excel 97, when you attempt to create a reference from one project to another project, you may receive the following error message:

Name conflicts with existing module, project, or object library


CAUSE

This behavior occurs when both projects have the same name.


RESOLUTION

To avoid this problem, rename the projects that have the same name. To do this, use one of the following methods.

Method 1

  1. In the Project Explorer pane in the Visual Basic Editor, look at the projects that are listed. You should see entries similar to the following:
    <VBAProject> (Book1.xls)
    <VBAProject> (Book2.xls)
    <VBAProject> (Personal.xls)
    where <VBAProject> is the name of the project.


  2. Click the entry for the project that you want to rename.


  3. On the Tools menu, click <VBAProject> Properties.

    where <VBAProject> is the name of the project.


  4. Click the General tab.


  5. In the Project Name box, type a new, unique project name.

    NOTE: Do not use a project name that you use in any other workbook.


  6. Click OK.


  7. On the File menu, click Save <bookname>, where <bookname> is the name of the workbook you modified.


  8. Repeat steps 1-7 for all open workbooks that contain Visual Basic modules, class modules, or userforms.


Method 2

  1. In the Project Explorer pane in the Visual Basic Editor, look at the projects that are listed. You should see entries similar to the following
    <VBAProject> (Book1.xls)
    <VBAProject> (Book2.xls)
    <VBAProject> (Personal.xls)
    where <VBAProject> is the name of the project.


  2. Click the entry for the project that you want to rename.


  3. In the Properties pane, in the box to the right of "(Name)", type a new, unique project name and press Enter.

    NOTE: Do not use a project name that you use in any other workbook.


  4. On the File menu, click Save <bookname>, where <bookname> is the name of the workbook you modified.


  5. Repeat steps 1-4 for all open workbooks that contain Visual Basic modules, class modules, or userforms.


After you rename all projects with unique project names, the error message no longer appears when you create a reference.


MORE INFORMATION

By default, when you create a new workbook in Microsoft Excel 97, the project name for the new workbook is "VBAProject" (without the quotation marks). This naming convention may cause a problem if you attempt to create a reference from one project to another when you use the following steps:

  1. On the Tools menu, click References.


  2. In the list of Available References, select (check) the check box for a project in another workbook.


  3. Click OK.


If you receive the error message when you click OK, you must change the name(s) of one or more of your projects. Projects with the same name cannot reference each other.


REFERENCES

For more information about changing project names in Microsoft Excel 97, click the Index tab in Visual Basic for Applications Help, type the following text

project properties dialog box
and then double-click the selected text to go to the "General Tab (Project Properties Dialog Box)" topic.

Additional query words: XL97 vbe 8.0

Keywords : kbprg kbdta xlui KbVBA
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: November 4, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.