Creating the PowerDesigner Application Object

PowerDesigner setup registers the PowerDesigner Application object by default.

You should check if the returned variable is empty.

When you create the PowerDesigner Application object, the current instance of PowerDesigner will be used, otherwise PowerDesigner will be launched.

If PowerDesigner is launched when you create the PowerDesigner Application object, it will be closed when you release the PowerDesigner Application object.

You create the PowerDesigner application object, using the following method in Visual Basic: CreateObject(ByVal Kind As Long, ByVal ParentCol As String = "", ByVal Pos As Long = -1, ByVal Init As Boolean = -1) As BaseObject

Example

' Defined the PowerDesigner Application object
 Dim PD As PdCommon.Application
 ' Get the PowerDesigner Application object
 Set PD = CreateObject("PowerDesigner.Application")

PowerDesigner Version Number

If you want to make sure that the application works with a selected version of PowerDesigner, you should type the version number in the PowerDesigner application object creation orders:

' Defined the PowerDesigner Application object
 Dim PD As PdCommon.Application
 ' Get the PowerDesigner Application object
 Set PD = CreateObject("PowerDesigner.Application.x")
'x represents the version number

If you do not use a particular feature of PowerDesigner, your application can work with any version of PowerDesigner and you do not need to specify a version number. In this case, the last version installed is used.

Note: You must release the PowerDesigner Application object before you exit the application in which you use it. To do so, you use the following syntax: Set Pd = Nothing.