Hi,
I am having a problem keeping the SW application open.
My problem is isolated to the following VB function. I open a part file and everything is fine .. but when I close the file, SolidWorks exits!
I want to open & close files repeatedly, but can't seem to keep SW open. Can anybody point out what I am doing wrong? I am new to SW and expect I may be doing something stupid.
Thanks, John MacIntyre VC++ / VB / ASP / Database Developer
----------------------------------------------------------------------------
------------------ Option Explicit
Sub Main() On Error GoTo ERR_HANDLER Const swDocPART = 1 Const sFileName = "MyTestPart.SLDPRT" Dim oApp As SldWorks.SldWorks Dim oDoc As SldWorks.ModelDoc2
Set oApp = New SldWorks.SldWorks oApp.Visible = True
Set oDoc = oApp.OpenDoc(sFileName, swDocPART) Debug.Print "Properties for " & sFileName Debug.Print vbTab & "Title :" & oDoc.SummaryInfo(0) Debug.Print vbTab & "Subject :" & oDoc.SummaryInfo(1) Debug.Print vbTab & "Author :" & oDoc.SummaryInfo(2)
Set oDoc = Nothing oApp.QuitDoc sFileName '