Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Integration > Solidworks VBA Macro Continue to Session.

Forum

Search UsersRules
Solidworks VBA Macro Continue to Session.
#1
Just came
Points:: 0
Joined:: Jan 21, 2013

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")

Profile
#2
Active user
Points:: 0
Joined:: Nov 19, 2012

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.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.