Microsoft KB Archive/126800

{|
 * width="100%"|

PRJ4: Can't Select/Rename/Delete Module in Project with Same Name

 * }

Q126800

-

The information in this article applies to:


 * Microsoft Project for Windows, version 4.0

-

SYMPTOMS
In Microsoft Project, when you use the Organizer to delete a module from a project file, you may receive the following error message

The module ' ' cannot be deleted

where is the name of the module that you are deleting.

Additionally, when you select the module from the Module list on the Visual Basic toolbar, you receive the following error message

Cannot find module '[ ] '

where is the name of the module that you are selecting and is the name of the project that contains the module.

CAUSE
This behavior occurs if the module that you are deleting, selecting or renaming has the same name as the project in which it is contained.

When you use the Rename Module dialog box to rename a module in a project, if you enter the a name for the module that is the same as the project file name and choose OK, you receive the following error message:

Name conflicts with existing module, project, or object library

However, if you use the Organizer to copy a module to a project that has the same name, the module is copied without receiving an error message. When this happens, you can view the module (by using the Macros dialog box to select a macro in the module, and choosing Edit), but you cannot select the module from the Visual Basic toolbar, and you cannot delete or rename the module.

Note that when you attempt to use the Organizer to rename a module in a project file that has the same name, you do not receive an error message; however, the module is not renamed.

WORKAROUND
To avoid receiving these error messages, do not use the Organizer to copy a module to a project that has the same name. Instead, rename the module before you copy it to the project.

MORE INFORMATION
Note that if you use the Organizer to copy the module in the project that has the same name back to the project file from which you originally copied it (replacing the existing module that has the same name), you receive a general protection (GP) fault if you then copy, rename, or delete this module in the original project file.