RA Facility
In the Open Standard
MS
Marcio SampaioMember for 20 years 11 months
- Created
- 12
- 1
0
12 replies
Oldest first- 0HDHannes de Bruyne ·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 - 0HDHannes de Bruyne ·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
- 0CAChristian Adrian De Vera ·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 - 0ARAbdul Raheem Mohammed ·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
Log in or join to reply
ProjectControls.com is free to join. Members can post questions, reply, vote and follow discussions.
Existing members: your original username and password still work. Forgot password?