AnsweredAssumed Answered

Solidworks crashes instead of closing

Question asked by Eimantas Palevicius on May 19, 2016

Hello,

 

I've written new macro to save drawings as PDF to the network location folder depending on the file name. Everything was fine until i added swmodel.printout4 option at the end of the macro. Macro does everything as it supposed to, but after it, if i try to close solidworks it just crashes instead of closing. Any ideas why this could be happening?

I use this code for printing:

Set swPrintSpecs = swModelDocExt.GetPrintSpecification

intCurrentSheet = swPrintSpecs.CurrentSheet

swPrintSpecs.AddPrintRange intCurrentSheet, intCurrentSheet

swModel.Printer = Default

swModelDocExt.PrintOut4 "", "", swPrintSpecs

swModel.Save3 swSaveAsOptions_Silent, lngErrors, lngWarnings

If lngWarnings = 4 Then

    swModel.Save3 swSaveAsOptions_UpdateInactiveViews, lngErrors, lngWarnings

ElseIf lngErrors > 0 Then

    MsgBox "Klaida: lngErrors"

    Exit Sub

End If

 

Regards

E.P.

Outcomes