AnsweredAssumed Answered

Close part or assembly at the end of the macro

Question asked by Stanislao Bazoli on Apr 5, 2018
Latest reply on Apr 6, 2018 by Stanislao Bazoli

Hi

I have this macro and I can not close the document at the end of the macro. What am I missing?

 

Dim swApp As Object

Dim Part As Object

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long

 

Sub main()

 

Set swApp = _

Application.SldWorks

 

Set Part = swApp.ActiveDoc

boolstatus = Part.FeatureManager.EditFreeze(swMoveFreezeBarTo_e.swMoveFreezeBarToEnd, "", True)

   

Part.SaveAs (Part.GetPathName)

 

swapp.CloseDoc part.GetTitle()

   

End Sub

Outcomes