Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Trying to launch Creo with Excel based macro, when it gets to the Set session=asyncConnection.session command, I receive a Run-time error '13': Type mismatch. Pasted below, any help on why I am getting this error is appreciated
Sub CreoTest()
'
' CreoTest Macro
'
'
Dim asyncConnection As IpfcAsyncConnection
Dim cAC As New CCpfcAsyncConnection
Dim session As IpfcBaseSession
Dim descModel As IpfcModelDescriptor
Dim descModelCreate As CCpfcModelDescriptor
Dim model As IpfcModel
Dim workDir As String
Dim position As Integer
' On Error GoTo RunError
'======================================================================
'First Argument : The path to the Pro/E executable along with command
'line options. -i and -g flags make Pro/ENGINEER run in non-graphic,
'non-interactive mode
'Second Argument: String path to menu and message files.
'======================================================================
Set cAC = New CCpfcAsyncConnection
' Set asyncConnection = cAC.Connect(Null, Null, ".", 5)
Set asyncConnection = cAC.Start("C:\PTC\Creo 2.0\Parametric\bin\parametric.exe", ".")
' + " -g:no_graphics -i:rpc_input", ".")
Set session = asyncConnection.session
'======================================================================
'Get current directory
'Set it as working directory
'======================================================================
workDir = ActiveWorkbook.FullName
position = InStrRev(workDir, "\")
Solved! Go to Solution.
Figured it out, needed to add pfcls. in my Dim commands
use
Set cAC As New CCpfcAsyncConnection
Figured it out, needed to add pfcls. in my Dim commands