Guild of Project Controls: Compendium | Roles | Assessment | Certifications | Membership

Tips on using this forum..

(1) Explain your problem, don't simply post "This isn't working". What were you doing when you faced the problem? What have you tried to resolve - did you look for a solution using "Search" ? Has it happened just once or several times?

(2) It's also good to get feedback when a solution is found, return to the original post to explain how it was resolved so that more people can also use the results.

Convert P3 to excel File.

7 replies [Last post]
James bid
User offline. Last seen 9 years 49 weeks ago. Offline
Joined: 8 Oct 2009
Posts: 50
Hi Guys!

May I ask your Expertise in converting a P3 file to Excel file.
I really appreciate anybody that can share their ideas.
thanks

Chris

Replies

Hannes de Bruyne
User offline. Last seen 1 year 50 weeks ago. Offline
Joined: 25 Jul 2005
Posts: 154
Groups: None
Hi Christopher

here teh small example

make a macro out of it in Excel:

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", "xxx")
password = ""
bret = session.Login(username, password, True)

Worksheets("Sheet1").Cells(1, 1).Value = "ActivityID"
Worksheets("Sheet1").Cells(1, 2).Value = "Description"
Worksheets("Sheet1").Cells(1, 3).Value = "Resource"
Worksheets("Sheet1").Cells(1, 4).Value = "BudgetedCost"
Worksheets("Sheet1").Cells(1, 5).Value = "BudgetedQuantity"
projectname = Application.InputBox("Please enter ProjectName:", "project", "yyyy")
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("Sheet1").Cells(xRow, 3).Value = res_id.ResourceName
Worksheets("Sheet1").Cells(xRow, 4).Value = res_id.BudgetedCost
Worksheets("Sheet1").Cells(xRow, 5).Value = res_id.BudgetedQuantity
xRow = xRow + 1
Next
ActNos = nos + 1
Application.StatusBar = ("Activity: " & xRow)
Next

session.closeproject proj
End Sub

Hannes de Bruyne
User offline. Last seen 1 year 50 weeks ago. Offline
Joined: 25 Jul 2005
Posts: 154
Groups: None
Hi Christopher,
the explanation of Paul is very good, maybe in simple words:
- ra is available after installing P3
- ra is a group of elements(functions etc.) to write a VBA-macro in Excel (or Access) in order to read from or write into the database of P3.
- some examples are available on the P3-CD, but they are quit complicated. Some years ago I wrote a very simple macro and posted it in this forum. Maybe you can find it, otherwise I will repost it
- Look for ra.hlp on your installation CD

DBF is an old format, quit simple, first a header with information about the data, followed by ascii-delimited data

Excel could read it, newest versions cannot write it anymore

Regards Hannes
Paul Harris
User offline. Last seen 1 year 22 weeks ago. Offline
Joined: 11 Apr 2001
Posts: 618
"The RA automation server grants access to all of P3’s advanced scheduling, leveling, cost calculations, resource data, and activity data through an
object-oriented automation layer based on the OLE 2.0 specification. RA offers the flexibility and power to customize existing tasks, link existing applications,
and build entirely new applications around P3’s functionality. RA enables you to work with P3’s project management functions, business processes, and
project data using any OLE-compliant development tool.
RA offers a major advantage over direct Open Database Connectivity (ODBC) access: RA adheres to P3 business rules. By writing to the RA API, the
underlying database is not a concern of the application builder. In contrast, by using direct links the developer would need to write different interfaces to
accommodate the different underlying databases.

By using the RA software developers kit (SDK), programmers can access and manipulate project data with standard programming tools such as Visual
Basic, Visual C++, and SoftBridge Basic Language (SBL). SBL is included on the RA CD-ROM (Compact Disc-Read Only Memory). RA will also work with
applications such as Microsoft Access and Excel through Visual Basic for Applications (VBA)."

The text above was copied from the Ra help file.

dbf is an old database format that may be exported by P3 and opened with Excel.

Paul E Harris
Eastwood Harris Pty Ltd, Melbourne, Australia
Planning and Scheduling Training Manual & Book Publishers, Consulting and Training
www.eh.com.au
www.primavera.com.au


James bid
User offline. Last seen 9 years 49 weeks ago. Offline
Joined: 8 Oct 2009
Posts: 50
Thanks Hannes!

May I know what is Ra is? Sorry I’m a beginner that why I have a lot of terminologies that don’t know.Can you please also give me step by step in using that software?
thanks in advance.

Chris
James bid
User offline. Last seen 9 years 49 weeks ago. Offline
Joined: 8 Oct 2009
Posts: 50
Thank you Paul. I tried that one for now and I succeeded.

Anyway here is another question, you mentioned dbf format? How is that work? do i need to download software or driver just to work on that format?
Please Advise.

Thanks

Chris
Paul Harris
User offline. Last seen 1 year 22 weeks ago. Offline
Joined: 11 Apr 2001
Posts: 618
The simplest methid is to display the columns of data and copy and paste, one of the few things you can not get out is the leads and lags, so you will need to export using say dbf format and open with Excel. Resource data may be exported by organising by resource.

Paul E Harris
Eastwood Harris Pty Ltd, Melbourne, Australia
Planning and Scheduling Training Manual & Book Publishers, Consulting and Training
www.eh.com.au
www.primavera.com.au
Hannes de Bruyne
User offline. Last seen 1 year 50 weeks ago. Offline
Joined: 25 Jul 2005
Posts: 154
Groups: None
Hi Christopher

a very nice method is using Ra, it has VBA like Excel, so you can read and write in both directions