Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi, I've been trying to connect to creo using Microsoft Visual Basic for Applications in Excel and it didn't work whatever I've tried.
Let's start from my setup:
Those are system variables that I'm using.
I've registered vb_api using vb_api_register.bat in administrator mode
I've added Creo VB Api......... to References
I'm not trying to open creo using api. I only want to connect to it using
Sub Connect()
Dim asynconn As New pfcls.CCpfcAsyncConnection
Dim conn As pfcls.IpfcAsyncConnection
Dim session As pfcls.IpfcBaseSession
Dim mdlname
Set conn = asynconn.Connect("", "", ".", 5)
End Sub
But no matter what i'm getting errors like this
If creo isn't running i'm getting error like this
Please suggest to me something so i can fix this
Solved! Go to Solution.
After all possible tries and errors I've stopped at this point
Adding parameters PRO_COMM_MSG_EXE andPRO_COMM_MSG and PRO_DIRECTORY
PRO_DIRECTORY FOLLOWS UP TO COMMON_FILES FOLDER
After addin all this parameters it is necessary to restart computer. No way it will work after adding parameters.
After restart it started working for a while.
Now approximately after an hour it shows following message. It's started while trying different functions. No reason for this message to appear. Creo model was all time opened and only data collection methods was applied. No changes in creo at all. Didn't even click one button in it.
Hi,
use PRO_COMM_MSG_EXE variable instead of PRO_COMM_MSG
After all possible tries and errors I've stopped at this point
Adding parameters PRO_COMM_MSG_EXE andPRO_COMM_MSG and PRO_DIRECTORY
PRO_DIRECTORY FOLLOWS UP TO COMMON_FILES FOLDER
After addin all this parameters it is necessary to restart computer. No way it will work after adding parameters.
After restart it started working for a while.
Now approximately after an hour it shows following message. It's started while trying different functions. No reason for this message to appear. Creo model was all time opened and only data collection methods was applied. No changes in creo at all. Didn't even click one button in it.
@ilyachaban wrote:
After all possible tries and errors I've stopped at this point
Adding parameters PRO_COMM_MSG_EXE andPRO_COMM_MSG and PRO_DIRECTORY
PRO_DIRECTORY FOLLOWS UP TO COMMON_FILES FOLDER
After addin all this parameters it is necessary to restart computer. No way it will work after adding parameters.
After restart it started working for a while.
Now approximately after an hour it shows following message. It's started while trying different functions. No reason for this message to appear. Creo model was all time opened and only data collection methods was applied. No changes in creo at all. Didn't even click one button in it.
Hi,
I cannot help you to solve the problem. I do not know what is your application doing and how did you program its functionality.
Now it is unable to connect again but with new error code is still the same.
Sub Connect()
Dim asynconn As New pfcls.CCpfcAsyncConnection
Dim conn As pfcls.IpfcAsyncConnection
Dim session As pfcls.IpfcBaseSession
Dim mdlname
Set conn = asynconn.Connect("", "", ".", 5)
End Sub
Error message is
Hi,
I am sorry, I am not able to help you.