API: no brainer ?
API: no brainer ?
(OP)
God, I hope this one is a "brainer" <grin>
using: SW03, SP0
I just want to FORCE a new instance of SW to start, whether an instance is running or not.
Tried CREATEOBJECT, and even the NEW keyword
(set swapp=NEW SldWrks.SldWrks)
both resulted in hooking the existing application.
I coulda swore CreateObject worked for second instances, in earlier versions (b4 2001, i believe)
using: SW03, SP0
I just want to FORCE a new instance of SW to start, whether an instance is running or not.
Tried CREATEOBJECT, and even the NEW keyword
(set swapp=NEW SldWrks.SldWrks)
both resulted in hooking the existing application.
I coulda swore CreateObject worked for second instances, in earlier versions (b4 2001, i believe)






RE: API: no brainer ?
Out of curiosity, why would you want another instance?
Anyway, it looks like you can shell a new instance. You'll have to use the existing instance to get the path of the executable, assuming you don't want to hardcode it. I just did this from a macro, so it may require some tweaking. But, run it and you'll get to applications.
Sub StartSWAgain()
Dim sPath As String, res
Set swApp = Application.SldWorks
sPath = swApp.GetExecutablePath
sPath = sPath & "\SldWorks.exe"
res = Shell(sPath, 1)
End Sub
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: API: no brainer ?
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: API: no brainer ?
but I still won't have the OLE object handle ...
'-------------------------------------------------
Set swApp = Application.SldWorks ' <--- handle of existing app
res = Shell(sPath, 1) ' <--- starts a second instance, but still have only the original OLE object handle.
'----------------------------------------------
Possibly I can use the processID here somehow.
The reason for this is that I have an application that runs pretty much continously, but does not take much resources.
It deals with SW files over a *slow* network connection, at several different IP's. Also, when opening assemblies, etc,
I generally have plenty of computing power left, the long delays are partially due to SW resolving references, etc.
Ive got 'uber-ram' in this box, so having an invisible copy that crawls around, doing it's thing, with an ability to run another copy manually on an as-needed basis, would be ideal.
RE: API: no brainer ?
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: API: no brainer ?
Regg