Macro to change solidworks models

Hello everyone,

I'm looking to create a macro  switcher my solidworks options (our service can work on BE or Method models) via a message box with choice

My attached macro  forces the change without any possible condition given to the user.

How do I add a userform with a list of choices?  two possible choices of Templates1  or Templates 2?

I don't know how to set the rowsource

 

If choice template 1 assign the path of template 1

If choice 2 assign the path of template 2

Thank you in advance for your feedback

Yannick


change_template.swp

Hello

Look at the attached example (very summary example to embellish a little) if it corresponds to what you want.

Kind regards


macrocombobox.swp
1 Like

Hello d.roger

The macro does not continue after the choice in the list box

We should have a control button that validates this choice?

How do I assign the value of the list box  choice if I click on the command button?

 

yannick

Thank you d.roger

I added a command button to validate the choice

Private Sub OK_Click()


MacroCombobox1.ChgtComboBox1
UserForm1.Hide

End Sub

Added a reset of the list box if macro used 2 x in a row.

UserForm1.ComboBox1.Clear

Thank you

 

yannick

1 Like