Microsoft KB Archive/255028

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Article ID: 255028

Article Last Modified on 1/27/2007



APPLIES TO

  • Microsoft Project 2000 Standard Edition
  • Microsoft Project 98 Standard Edition



This article was previously published under Q255028

SYMPTOMS

In Microsoft Project, when you open a project that was saved in the Microsoft Project 98 file format from Microsoft Project 2000, you may see the following behavior.

Symptom 1

You receive one of the following messages, even though you did not create any macros in the project.

In Microsoft Project 98

The project you are opening contains macros.
Some macros may contain viruses that could be harmful to your computer.

If you are sure this project is from a trusted source, click 'Enable Macros'. If you are not sure and want to prevent any macros from running, click 'Disable Macros'.

In Microsoft Project 2000

path\name.mpp contains macros.

Macros may contain viruses. It is always safe to disable macros, but if the macros are legitimate, you might lose some functionality.

Symptom 2

When you open the project in either Microsoft Project 98 or Microsoft Project 2000, one or more macros that were saved in the project may not be listed in the Macros dialog box. If macros saved in the project are listed, you cannot run the macros or open the Visual Basic Editor to edit the macros.

NOTE: In Microsoft Project 2000, when you open the project or when you try to open the Visual Basic Editor to edit a macro in the project, you also receive the following message:

Microsoft Visual Basic

Error accessing file. Network connection may have been lost.

Symptom 3

When you open the project in either Microsoft Project 98 or Microsoft Project 2000, and you try to create or record a new macro in the project, either nothing happens, or you receive the following message:

"name" is not a valid macro name.

A macro name must begin with a letter and can contain letters, numbers, and the underscore character. It cannot contain spaces or be a word that Microsoft Project reserves as a keyword.

CAUSE

Cause for Symptom 1

To ensure that macros are transferred properly, when Microsoft Project 2000 saves a project in the Microsoft Project 98 format, it adds the following Visual Basic for Applications (VBA) statement to the project's Project_Open event:

ThisProject.VBProject.Description = ThisProject.VBProject.Description
                

The statement includes the following explanatory comment:

'While saving your file to Microsoft Project 98 format, Microsoft
Project 2000 added this line to ensure that your VBA macros
are loaded properly
                

When you open the project in Microsoft Project 98, this statement causes Microsoft Project 98 to save the project's Visual Basic project (VBProject) using the version of VBA that is included with Microsoft Project 98.

If built-in macro virus protection is enabled when you open the project in Microsoft Project 98 or Microsoft Project 2000, you receive the macro virus warning described in the "Symptoms" section. This is because the project now contains the macro code that Microsoft Project 2000 added.

Cause for Symptom 2 and Symptom 3

Symptoms 2 and 3 may occur when you do the following:

  1. In Microsoft Project 2000, you create one or more macros in a project.
  2. You save the project in the Microsoft Project 98 file format.
  3. In Microsoft Project 98, the Macro virus protection check box is selected (checked). (To locate this option, click Options on the Tools menu, and then click the General tab.)
  4. When you open the project in Microsoft Project 98, you click Disable Macros when you are prompted.
  5. While you have the project open in Microsoft Project 98, you do either or both of the following:
    • You start the Visual Basic Editor, but you do not edit any of the macros contained in the VBProject object for the project.
    • You run a macro that is contained in any open project or in the global template.
  6. You save the project in Microsoft Project 98.
  7. You open the project again, in either Microsoft Project 98 or Microsoft Project 2000.

This behavior occurs because if you click Disable Macros when you open the project in Microsoft Project 98, the statement that Microsoft Project 2000 added to the Project_Open event (as described in the "Cause for Symptom 1" section) cannot run.

If you then run any macro, or you open the Visual Basic Editor without editing a macro, Microsoft Project 98 initializes the project's Visual Basic project (VBProject object), but does not properly save the VBProject object using the Microsoft Project 98 version of VBA. This results in the problems described for Symptom 2 and Symptom 3.

If you click Enable Macros, the Project_Open procedure runs, and Microsoft Project 98 will correctly save the VBProject object.

WORKAROUND

To work around the problems described under "Symptom 2" and "Symptom 3," whenever you open a project in Microsoft Project 98 that was saved from Microsoft Project 2000, use either of the following methods:

  1. Click Enable Macros when you are prompted.

    -or-
  2. Open the Visual Basic Editor and modify at least one macro contained in the VBProject object for the project. By doing this, you force Microsoft Project 98 to correctly save the VBProject object.

    If you do not need to make any revisions to the macro code, you can add a comment line to the macro. For example, add the following line to any macro contained in the project:

    ' comment to avoid losing macros in this project
                        

To work around these symptoms after they have occurred, use one of the methods below, as appropriate for your situation.

Method 1: If You Can Create New Macros in the Project

If macros that were saved with the project are no longer listed in the Macros dialog box, but you are able to create new macros in the project, there is no direct workaround to recover the missing macros. You need to either copy the macros from a backup copy of the project, or re-create them.

Method 2: If You Cannot Create New Macros in the Project

If you cannot create new macros or open the Visual Basic Editor in the project, you need to re-create the project file to recover the VBProject object for the project. To re-create the project file without having to reenter the project data, follow these steps:

NOTE: Unless you no longer intend to use the Microsoft Project 98 file format for this project, you should perform the following steps in Microsoft Project 98, to maintain consistency in the project format.

  1. In Microsoft Project 98, open the project that you need to re-create. (In the steps that follow, this project is referred to as "Project1.mpp.")
  2. On the Project menu, click Project Information. Make a note of whether Project1.mpp is scheduled from the project start date or the project finish date, along with the corresponding start date or finish date.
  3. In the Project Information dialog box, click Cancel.
  4. On the File menu, click New.
  5. If you see the Project Information dialog box, click OK to accept the defaults.
  6. On the File menu, click Save. Save the new project with a name that is different than the project that you are re-creating. (In the steps that follow, the new project is referred to as "Project2.mpp.")
  7. In Project2.mpp, click Project Information on the Project menu. In the Project Information dialog box, make the following changes:
    • If Project1.mpp is scheduled from the project start date, change the Start date setting to the same start date as Project1.mpp.
    • If Project1.mpp is scheduled from the project finish date, in the Schedule from list, click Project Finish Date, and then change the Finish date setting to the same project finish date as Project1.mpp.
  8. In the Project Information dialog box, click OK.NOTE: If Project1.mpp contains customized information such as customized base calendars, views, or tables, follow steps 9 through 12 to open the Microsoft Project Organizer and copy the customized information into the new project. Otherwise, skip to step 13.

  9. On the Tools menu, click Organizer.
  10. In the Organizer dialog box, on the left side, in the Views available in list, click Project1.mpp.

    NOTE: At this point you should see Project1.mpp listed on the left side of the Organizer dialog box, and Project2.mpp listed on the right side.
  11. For each of the tabs in the Organizer dialog box, follow these steps:
    1. Click the tab (for example, click the Views tab).

      NOTE: If there are Task and Resource options available on the tab, the Task option is selected by default. After you follow steps b and c for the Task option, click Resource, and then repeat steps b and c for the Resource option.
    2. For each item listed under Project1.mpp, select the item, and then click Copy.
    3. If you are prompted whether to replace an item that already exists in Project2.mpp, click Yes.
  12. In the Organizer dialog box, click Close.
  13. On the File menu, click Save.
  14. On the Window menu, click Project1.mpp.
  15. In the Project1.mpp window, click Resource Sheet on the View menu.
  16. Click the Select All button (the blank button at the upper-left corner of the Resource Sheet table).
  17. On the Edit menu, click Copy Resource.
  18. On the Window menu, click Project2.mpp.
  19. In the Project2.mpp window, click Resource Sheet on the View menu.
  20. On the Edit menu, click Paste.
  21. On the Window menu, click Project1.mpp.
  22. In the Project1.mpp window, click Gantt Chart on the View menu.
  23. Click the Select All button (the blank button at the upper-left corner of the Gantt Chart table).
  24. On the Edit menu, click Copy.
  25. On the Window menu, click Project2.mpp.
  26. In the Project2.mpp window, click Gantt Chart on the View menu.
  27. On the Edit menu, click Paste.
  28. On the File menu, click Save.


STATUS

Microsoft has confirmed this to be a problem in Microsoft Project 98.

REFERENCES

For more information about the statement that Microsoft Project 2000 adds to the Project_Open event for a file saved in Microsoft Project 98 format, see the "Exchanging Files With Microsoft Project 98" topic in the Readme.txt file that is included with Microsoft Project 2000. The Readme.txt file is located in the root folder of the Microsoft Project 2000 installation CD or network installation point.


Additional query words: prj98 prj2000

Keywords: kbbug kbdtacode kbpending KB255028