## PRJ: LinkPredecessors/LinkSuccessors Method May Crash

Q115244

The information in this article applies to:

- Microsoft Project for Windows, version 4.0

## SYMPTOMS

In Microsoft Project, when you use either the LinkPredecessors or LinkSuccessors method in a Visual Basic, Applications Edition, module, you may receive a general protection (GP) fault.

## CAUSE

This problem occurs when you use the Tasks collection as the Tasks argument without indicating a particular task (that is, the index number is not provided).
The "Tasks" parameter requires an indexed object.

## STATUS

Microsoft has confirmed this to be a problem in the Microsoft products that are listed at the beginning of this article.

## MORE INFORMATION

### Steps to Reproduce Behavior

1. In a new project, enter four tasks.
2. Enter the following Visual Basic, Applications Edition, macro:

          Sub Test()
              Set T = ActiveProject.Tasks
              For i = 1 to (T - 1)
                  ActiveProject.Tasks(4).LinkPredecessors Tasks:=T
              Next i
          End Sub

3. From the Tools menu, select Macros. Find and select Test Macro, and choose Run.

Microsoft Project will display the error message

> An error has occurred in your application....

To use the LinkPredecessors or LinkSuccessors methods correctly, make the following change to your code:

       ActiveProject.Tasks(4).LinkPredecessors Tasks:=T(i)

Additional query words: hang lock up freeze gpf

Keywords : kbcode kbmacro
Issue type : kbbug
Technology : kbProjectSearch kbProject400

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