VBA - Bring up the Save As window

Hello 

How do I make the "save as" window appear in solidworks automatically with a macro (VBA)? 

Thank you for your help.

Hello

Here is the method to use:

http://help.solidworks.com/2012/english/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IModelDocExtension~SaveAs.html

See also the use of "swModdoc.SaveAs (CommonDialog1.FileName)" in this macro:

https://forum.solidworks.com/thread/53968

Or here:

https://forum.solidworks.com/message/249307#249307

And here  ModelDocExtension::SaveAs:

http://help.solidworks.com/2013/english/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IModelDocExtension~SaveAs.html

2 Likes

Thank you so much for your help, how can I retrieve the name of my parts, mep and assembly in order to close them after registration? 

myTitle = myModel.GetTitle

swApp.ActivateDoc2 myTitle, True, 0

swApp.QuitDoc myTitle

I tried this but it doesn't work. I also can't find the command to simply save my assembly.

1 Like

This question is a little outside the scope of the first question.

Why not ask another question, it allows more visibility, and if some people ask the same question, they will find the answer more easily!

1 Like

Hello 

I'm restarting this conversation to find out if it's possible using the same command, to open the window directly in a specified link, the goal would be to retrieve the first link that the user specifies for the first part and not the one of the source part for the parts to follow! 

 

bool = swmodel. Extension.RunCommand(SwCommands.swCommands_SaveAs, "")

Thank you for your help!