PRJ4: Error When You Use a Macro to Consolidate Files

ID: Q130969

The information in this article applies to:

SYMPTOMS

Microsoft Project will generate an application error when you run a macro that is designed to merge a file into an active, combined project. This situation applies to combined windows and projects that have been consolidated and attached to source files.

RESOLUTION

When you use a macro to import a file, load the file without merging it. This will create a new "project" with the imported information. In Visual Basic for Applications, the command would be similar to the following example:

   Sub import()
       FileOpen Name:="Filename.txt", Merge:=pjDoNotMerge, _
       TaskInformation:=true
   End Sub

The constant pjDoNotMerge will force the imported information (either Text, .CSV, and so on) into a new project.

NOTE: When this procedure is done manually, Microsoft Project does not allow merging at all. When you do it via a macro, however, any file type other than MPX or MPP will cause this problem.

Microsoft provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose.

STATUS

Microsoft has confirmed this to be a problem in the products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

A combined window of projects, in Microsoft Project is not a project in itself, but it is an image of selected projects combined in a separate window pane. Importing and merging a file requires the active window to be a true "project."

You cannot merge information into a consolidated project file (that is, a file that attaches itself to source project).

Additional query words: 4.00

Keywords          : kbcode kbprg
Version           : 4.0
Platform          : MACINTOSH WINDOWS

Last Reviewed: November 25, 1997