Trying to get a simple connection to a running session of Creo 2 for starters, but I keep getting a "pfcExceptions::XToolkitAmbiguous" error when trying to connect.
Following system environment variables are set:
PRO_COMM_MSG_EXE "C:\Program Files\PTC\Creo 2.0\Common Files\M230\x86e_win64\obj\pro_comm_msg.exe" (also tried it without the _EXE, no change)
PTC_WF_ROOT "C:\data\StartCreo"
PRO_DIRECTORY "C:\Program Files\PTC\Creo 2.0\Parametric"
PFCLS_START_DIR "C:\Program Files\PTC\Creo 2.0\Common Files\M230\x86e_win64\obj"
I've run "vb_api_register.bat" as admin and selected the reference in Excel, and also run "protk_unlock.bat" which I saw recommended on another post.
I'm pretty competent in VBA and programming with several years of it under my belt...but for some reason this is kicking my arse.
Here is the simple VBA code:
Private Sub CommandButton1_Click()
Dim asyncConnection As IpfcAsyncConnection
Dim cAC As CCpfcAsyncConnection
Set cAC = New CCpfcAsyncConnection
Set asyncConnection = cAC.Connect(dbnull, dbnull, dbnull, dbnull)
Stop
If Not asyncConnection Is Nothing Then
If asyncConnection.IsRunning Then
asyncConnection.End
End If
Set cAC = Nothing
Set asyncConnection = Nothing
End If
End Sub