The code given in the question finally works in Excel but does not perform the correct function. Indeed, it opens the "Open" window of Solidworks instead of the "Save As" window...
Public Sub enregistrer_fichier() ' We get Solidworks back Set swApp = GetObject(, "SldWorks.Application") ' We retrieve the active document in solidworks Set swModel = swApp.ActiveDoc ' We open the registration dialog box swModel.Save ' We close the file swApp.CloseDoc swModel.GetTitle End Sub
Thank you for your answer. The code works but doesn't correspond to what I wanted to get.
Indeed, it saves the modified file while I would like to save a copy in another directory and under another name in order to keep the base file without modification.
I tried to replace the swModel.Save with swModel.SaveAs but it doesn't work anymore.
For the saveas, you have to provide it with the recording path as well as the name of the file as an argument I don't think you already know where it should be registered and under what name
In addition, the saveas will not open the registration dialog from what I understand