RA Facility

Member for

17 years 11 months

Hi ALL

I had a thought of using Ra to export all data from my project to EXCEL in the same format as layout in P3 so that when a person at remote site location or site engineer look at this EXCEL sheet can easily understand the area of each activity and update(write in Excel sheet) actual dates.

So that when i recieve this file at head office it can be just uploaded to get monthly update.



So is there any code script you konw which should arrange activities in excel area wise as per "layout 01" in p3



please advise



thank you and regards

Member for

20 years

Thanks IC ... now i found it.



Regards.

Member for

20 years

Milind,



I thought that I would find it on installation CDs. But i’m not finding.



IC,



Could u please tell us where are this files??



Thanks and regards.



Marcio Eduardo.


Member for

20 years 2 months

can any one tell me from where i wiill get the CD to study

Member for

20 years

Thanks IC;



I’m going to see this files on CD and study more about RA.



Regards.

Member for

20 years 6 months

Excel can only record the operation in Excel,

For RA, you must write you own code,

the above code is quite simple, but useful.

it demostrate how to login in P3 (RA) and open project file.

It’s always require while using RA

Member for

22 years 5 months

Hello Hannes,



Agree with you that creating your own macro would be better than RA facility but I also think that RA is only a template and each user can customize it according to their specific data requirement...



btw would there be any shorter version of your codes? ;-)

as for me I’m not quite familiar with VBA scripts but what I do is just record the steps to create my macros... just adding my thoughts...



Cheers!



Christian

Member for

20 years

Hello Hannes de Bruyne;



Great!!!



Thanks a lot.



Kind regards.



Marcio Eduardo.

Member for

20 years 3 months

Hi



just open an Excel-sheet,

than Extras ->Macros ->VisualBasicEditor



Copy following Text into the Edito sheet. It is a short macro, much shorter than the example of Primavera, therefore it can be understood very easy. You Excel-File must have two sheets named:P3-Resources and Success



Dim session As Object

Dim proj As Object

Dim act As Object

Dim res_id As Object

Dim succes As Object

Dim bret As Boolean

Dim username, password, projectname As String

Dim xRow, ActNos As Integer

Dim sheet As Workbooks



Sub Primavera()

Set session = CreateObject("P3Session")

username = Application.InputBox("Please enter Username:", "login", "debruyne")

password = ""

bret = session.Login(username, password, True)



Worksheets("P3-Resources").Cells(1, 1).Value = "ActivityID"

Worksheets("P3-Resources").Cells(1, 2).Value = "Description"

Worksheets("P3-Resources").Cells(1, 3).Value = "Resource"

Worksheets("P3-Resources").Cells(1, 4).Value = "BudgetedCost"

Worksheets("P3-Resources").Cells(1, 5).Value = "BudgetedQuantity"

projectname = Application.InputBox("Please enter ProjectName:", "project", "li01")

Set proj = session.openproject(projectname, 0, 99)

xRow = 2

ActNos = 1

For Each act In proj.activities

Worksheets("P3-Resources").Cells(xRow, 1).Value = act.ActivityID

Worksheets("P3-Resources").Cells(xRow, 2).Value = act.Description

For Each res_id In act.ResourceAssignments

Worksheets("P3-Resources").Cells(xRow, 3).Value = res_id.ResourceName

Worksheets("P3-Resources").Cells(xRow, 4).Value = res_id.BudgetedCost

Worksheets("P3-Resources").Cells(xRow, 5).Value = res_id.BudgetedQuantity

xRow = xRow + 1

Next

ActNos = nos + 1

Application.StatusBar = ("Activity: " & xRow)

Next





Worksheets("Success").Cells(1, 1).Value = "ActivityID"

Worksheets("Success").Cells(1, 2).Value = "Description"

Worksheets("Success").Cells(1, 3).Value = "Driving"

Worksheets("Success").Cells(1, 4).Value = "Successor"

Worksheets("Success").Cells(1, 5).Value = "Lag"

Worksheets("Success").Cells(1, 6).Value = "Type"

xRow = 2

ActNos = 1

For Each act In proj.activities

Worksheets("Success").Cells(xRow, 1).Value = act.ActivityID

Worksheets("Success").Cells(xRow, 2).Value = act.Description





For Each succes In act.Successors

Worksheets("Success").Cells(xRow, 3).Value = succes.IsDriving

           Worksheets("Success").Cells(xRow, 4).Value = succes.SuccessorActivityId

Worksheets("Success").Cells(xRow, 5).Value = succes.RelationShipLag

Worksheets("Success").Cells(xRow, 6).Value = succes.RelationShipType



xRow = xRow + 1

Next

ActNos = nos + 1

Application.StatusBar = ("Activity: " & xRow)

Next



session.closeproject proj

End Sub

Member for

20 years

Thanks a lot Hannes de Bruyne;



Could u please show us the example u have??



I would appreciate a lot.



Kind regards,



Marcio Eduardo.

Member for

20 years 3 months

Yes, I have quit a lot of exprience with RA - RA is like Visual Basic for Applications in Excel or Access. Therefore it has the same advantages. In fact you can combine VBA with RA, so that P3 can comunicate with Office-applications (including MS-Project). Quit useful. I can help you with a simple example.



Regards Hannes

Member for

20 years

And could u please explain advantages and usage of RA?