I created the macro below to do a silent save but as you can see from the code it actually launches two saves, one to save the active doc and one to save the referenced docs. Can someone please show me how to change the code so that the active doc and referenced docs are all saved with one save?
Thanks
Sub main()
Dim swApp As Object Dim SaveOptions As Long Dim SaveSuccess As Boolean Dim Modeldoc As SldWorks.ModelDoc2 Dim DocErrors As Long Dim DocWarnings As Long Dim DocOptions As Long
Set swApp = Application.SldWorks Set Modeldoc = swApp.ActiveDoc
SaveOptions = swSaveAsOptions_Silent SaveSuccess = Modeldoc.Save3(SaveOptions, DocErrors, DocWarnings) 'Save parent doc
SaveOptions = swSaveAsOptions_SaveReferenced SaveSuccess = Modeldoc.Save3(SaveOptions, DocErrors, DocWarnings) 'Save referenced docs
End Sub