Critical Path Method implementation in VBA, C# or For 2003 MS Excel

Okay Guys, here is what i need: i need an application or codes (VBA codes or C# or Whatever with an excel work sheet but prefer something like excel macro). I am looking to have an Application That Would Analysis The Critical Path of An Activity from a Primavera P3e (Ver. 5) project that has hundreds of Critical Float Path that i have to usually work from in an excel spreadsheet. I will provide the excel sheet of the projects once i have located the indiviual that will work on this project. I have founds information online about creating the CPM algorithm.

Application Should be able to Provide me with Critical Path Logic or chain and the Successor Activity or Predecessor Activity that is causing the delay and also with (the Early Start or Early Finish --- Late Start or Late Finish) From the excel worksheet that i will update when i need to present the Critical path in meeting.

I would also like to have a Gantt Chart View of the Activity Logic Just for just the Activity that is been examine. I will Provided the Excel Worksheet that has The Our Standard Layout.

I will also provided more details when, one of you guys wins the project.

I have provided two documents that would aid you on what i really want done...since my summary might not be enough.

thanks you,


The Critical Path Method or just CPM is a mathematically based algorithm for scheduling a set of project activities.


The essential technique for using CPM is to construct a model of the project that includes the following:

• A list of all activities required to complete the project (also known as Work Breakdown Structure),

• The time (duration) that each activity will take to completion, and

• The dependencies between the activities.

For a test case let's assume the following picture:

In the picture above we have circles that represent activities identified by capitalized letters.

The red number inside each circle indicates the time spent to complete the activity.

The upper left and right numbers represent the earliest start time and earliest end time of each activity respectively. The lower left and right numbers represent the latest start time and latest end time of each activity respectively.

The circles with a red border represent the critical path for this given set of activities.

Using the code

A class that represents each activity was firstly modeled. This class has as properties the activity's ID, description and duration along with the earliest start time (est), latest start time (lst), earliest end time (eet) and latest end time (let).

The dependencies between each activity is stored in two arrays, the successors and predecessors arrays.

Collapse Copy Code

public class Activity


private string id;

private string description;

private int duration;

private int est;

private int lst;

private int eet;

private int let;

private Activity[] successors;

private Activity[] predecessors;



The CPM algorithm uses the activities data to calculate the longest path of planned activities to the end of the project, and the earliest and latest that each activity can start and finish without making the project longer. This process determines which activities are "critical" (i.e., on the longest path) and which have "total float" (i.e., can be delayed without making the project longer).

To accomplish that two methods were created: one called WalkListAhead and the other called WalkListAback.

The WalkListAhead method receives the array that stores the activities and performs the forward walking inside the array calculating for each activity its earliest start time and earliest end time.

After the forward walking the WalkListAback performs the backward walking calculating for each activity its latest start time and latest end time.

The WalkListAhead and WalkListAback methods implementation:

Collapse Copy Code

private static Activity[] WalkListAhead(Activity[] list)


list[0].Eet = list[0].Est + list[0].Duration;

for(int i = 1; i < na; i++)


foreach(Activity activity in list[i].Predecessors)


if(list[i].Est < [url removed, login to view])

list[i].Est = [url removed, login to view];


list[i].Eet = list[i].Est + list[i].Duration;


return list;


private static Activity[] WalkListAback(Activity[] list)


list[na - 1].Let = list[na - 1].Eet;

list[na - 1].Lst = list[na - 1].Let - list[na - 1].Duration;

for(int i = na - 2; i >= 0; i--)


foreach(Activity activity in list[i].Successors)


if(list[i].Let == 0)

list[i].Let = [url removed, login to view];


if(list[i].Let > [url removed, login to view])

list[i].Let = [url removed, login to view];


list[i].Lst = list[i].Let - list[i].Duration;


return list;


To calculate the critical path, a method called CriticalPath verifies if each activity's earliest end time minus the latest end time and earliest start time minus the latest start time are equal zero. If so, the activity is part of the critical path and its Id is written in the screen. The project's total duration is also shown.

The CriticalPath method implementation:

Collapse Copy Code

void CriticalPath(Activity[] list)


Console.Write"n Critical Path: ");

foreach(Activity activity in list)


if(([url removed, login to view] - [url removed, login to view] == 0) && ([url removed, login to view] - [url removed, login to view] == 0))

[url removed, login to view]("{0} ", [url removed, login to view]);


[url removed, login to view]("nn Total duration: {0}nn", list[[url removed, login to view] - 1].Eet);


Kemahiran: Pengaturcaraan C, Excel, Pengurusan Projek, Visual Basic, XML

Lihat lagi: critical path method, critical path method implementation, impl, critical path algorithm, critical path method algorithm, excel vba critical path, vba critical path method, critical path method excel, critical path method code, cpm algorithm vba, critical path vba, vba critical path, code critical path method, critical path algorithm vba, vba critical path logic, critical path method algorithm vba, calculate critical path method, primavera vba, code critical path, critical path implementation, critical path method software development, successor based critical path implementation, path vba, vba calculate critical path, critical path analysis excel

Tentang Majikan:
( 0 ulasan ) Culver City, United States

ID Projek: #340352

Dianugerahkan kepada:


Waste less $, and get Critical Path solution from a Software Engineer, who also got MATHs Post Graduate degree. I am also having 7+ years experience. I am an Expert of C# and Excel-VBB, so i am the perfect coder for th Lagi

$250 USD dalam 8 hari
(76 Ulasan)

5 pekerja bebas membida secara purata $237 untuk pekerjaan ini


The buyer's Critical Path write up courtesy of the CodeProject.. [url removed, login to view] Hello my name is Bill.. I Lagi

$249.95 USD dalam 5 hari
(25 Ulasan)

Please check PM.

$250 USD dalam 0 hari
(2 Ulasan)

Dear Newport Films! I am an experienced VB and VBA programmer and would be happy to work for you. Please, check PMB.

$235 USD dalam 4 hari
(16 Ulasan)

We are a group of software developers having more than 5 years of experience in sw developement we believe in providing high quality solutions in promised deadlines

$200 USD dalam 45 hari
(1 Ulasan)