by PRICE Systems
| September 25, 2014
The new TruePlanning COM Application Programming Interface (API) found in the 2012SR1 release of TruePlanning provides a powerful mechanism for leveraging the power of TruePlanning within custom solutions. Through the COM API TruePlanning projects can be created, updated, calculated and saved allowing for near limitless potential for integration with TruePlanning. That said it is an “API” which means some programming will need to be done. This discussion is focused on how to get started using the TruePlanning COM API.
The TruePlanning COM API is written in C++, but is available to any programming environment that can work with COM. Such environments include Visual Studio for the .NET languages, unmanaged C++, java and Visual Basic for Applications (VBA).
For the purposes of this discussion, VBA from Excel will be used as it is the most ubiquitous development platform in Windows. Anyone with Excel can make use of the TruePlanning API and Excel is the most common application users need to integrate with TruePlanning. It is also very forgiving and requires the least experience to start creating amazing integrations with TruePlanning.
Creating a TruePlanning project through VBA
The following steps will prepare the Excel VBA environment to use the TruePlanning COM API (TPCOM), create a project, and then save that project. Excel 2007 is the version of Excel being used in this discussion. If a different version is being used some of the screen shots may look different, and some of the set up steps will be different, but the code is shown will work.
So let’s get going creating an integration between TruePlanning and Excel!
b. Click the References option. This will launch the references dialog.
c. Locate the “TruePlanningApi 12.1 Type Library” and check the checkbox in front of it to select it.
d. Click OK.
Dim app As TruePlanningApi.Application
Set app = New TruePlanningApi.Application
Dim ses As TruePlanningApi.Session
Set ses = app.Login("(local)")
Dim proj As TruePlanningApi.Project
Set proj = ses.Projects.New("MyNewProject")
Set proj = Nothing
Set ses = Nothing
Set app = Nothing
Private Sub CommandButton1_Click()
In the end the above steps are not particularly complicated. After working with the above code. the use of the TruePlanningApi Application, Session, and Project objects will become second nature. The above steps, while detailed, really take minimal time to set up and allow users to perform very powerful tasks with TruePlanning. Questions can be sent to email@example.com.
PRICE Systems L.L.C.