I think if you change the argument for CloseDoc from part.GetTitle() to part.GetPathName then it should close properly.
Replace the last line with this swapp.CloseDoc(part.GetTitle)
Try to change
Call Part.SaveAs (Part.GetPathName)
I've tried all your suggestions, but it does not work.... Other suggestions?
I have DBworks. Can that be the problem?
Try changing the first 2 variable callouts to:
Dim swApp As Sldworks.Sldworks
Dim Part as Sldworks.ModelDoc2
It should have worked fine with both of those variables set to Objects but just incase, give that a shot.
Yes, that might be the case. Pdm systems might control the process of saving, closing and opening of the files in order to sync them with vault. Try to disable dbworks. Btw. Your macro works for me.
It does not work even with the Pdm off
Why the heck are you doing a SaveAs to the current file name? Just curious. The ModelDoc2 object has a Save method that you don't have to pass a path to.
I think you have the solution for me. I would be grateful if you could help me by correcting the macro
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Set swApp = _
Set Part = swApp.ActiveDoc
Set Part = Nothing