Solidworks VBA Macro Continue to Session.

1C:Enterprise platform integration capabilities and techniques

#1
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jan 21, 2013
Company:

Hello I am trying to make a Macro In Solidworks vba. To get new Product Number. Each time when the macro Works It opens new session. How to solve this. Thanks in advance.

Code
Set Con_1C = CreateObject("V82.Application")
Con_1C.Connect ("Srvr=SUNUCU;Ref=Production;Usr='Adm';Pwd=123456")

 
#2
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Nov 19, 2012
Company:

Hey,

I think you have 2 options:
1) if this environment allows you to store value in global variable - you can create COM-connection once, store it in global variable and use it later in next iterations. However, connection can be terminated for many reasons and you should consider it in your code. And it is not a good practice.
2) in this situation would be way much better to use a web-services or HTTP-services. It works faster and more predictable.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.