cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Connecting to Creo

ilyachaban
14-Alexandrite

Connecting to Creo

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. 

ilyachaban_0-1698231646425.png

I've registered vb_api using vb_api_register.bat in administrator mode

 

I've added Creo VB Api......... to References 

ilyachaban_1-1698231907448.png

 

 

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 

Screenshot 2023-10-25 125417.png

Screenshot 2023-10-25 125128.png

Screenshot 2023-10-25 125328.png

 

If    creo isn't running i'm getting error like this 

Screenshot 2023-10-25 125746.png

 

Please suggest to me something so i can fix this

ACCEPTED SOLUTION

Accepted Solutions
ilyachaban
14-Alexandrite
(To:MartinHanak)

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

ilyachaban_0-1698238513550.png

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_1-1698238646850.png

 

View solution in original post

5 REPLIES 5

Hi,

use PRO_COMM_MSG_EXE variable instead of PRO_COMM_MSG


Martin Hanák
ilyachaban
14-Alexandrite
(To:MartinHanak)

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

ilyachaban_0-1698238513550.png

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_1-1698238646850.png

 


@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

ilyachaban_0-1698238513550.png

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_1-1698238646850.png

 


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.


Martin Hanák
ilyachaban
14-Alexandrite
(To:MartinHanak)

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 

ilyachaban_0-1698239505661.png

 

Hi,

I am sorry, I am not able to help you.


Martin Hanák
Announcements


Top Tags