Combo Box and User Form Help

Hi, I am new to programming and am trying to learn as much as I can.  I was somehow able to make a macro, but I am trying to add a simple user form and I am having trouble determining what code to use and where to use it.  My form just has 1 combo box and 1 command button.  I would like the combo box to contain a list of all the drawing views that are in the view pallete in the active drawing.  The user will then select the view they would like from the combo box and hit the command button and then the rest of the macro would run by taking the view, dropping on the sheet, exploding it, inserting BOM table, and add balloons to the view.  I just can't figure out the code to use for the combo box/user form.  Any help will be greatly appreciated.

John

SolidworksApi macros
Answers 2
SF
SF 2012-10-15 Best Answer

From solidworks VBA, go to Insert (top toolbar) >>> Userform.  Double click on the form and enter this code:

'************************************************************************************

'''

''' Code to run when user clicks the "OK" button

'''

Private Sub CommandButton1_Click()

    'Do Your Code Here

    MsgBox ComboBox1.Text

    Unload Me   'Terminates and closes the form / Program

End Sub

'''

''' Code to run when the form initializes / loads.

'''

Private Sub UserForm_Initialize()

    ComboBox1.Text = "