I Suck at User Forms

I've been beating my head into a wall to try to figure out how to get a combobox userform to work in the SW VBA environment. I might have to ask for complete guidance on everything I want to do, but for now I'll try to do it myself. I'm completely new to VBA userforms so I might be missing something obvious.

Here is what the userform is supposed to look like at the moment. The items are for example only.

<p>Private Sub CommandButton1_Click()</p><p></p><p>If Me.ComboBox1.ListIndex = -1 Then</p><p>  MsgBox "A value is required for the material. Ending macro. Please try again."</p><p>  Me.ComboBox1.SetFocus</p><p>  Cancel = True</p><p>  Unload Me</p><p>  End</p><p>End If</p><p></p><p>Unload Me</p><p></p><p>End Sub</p><p></p><p>Private Sub UserForm_Initialize()</p><p></p><p>Dim selectedItem1 As Object</p><p></p><p>     Me.ComboBox1.AddItem "Aluminum"</p><p>     Me.ComboBox1.AddItem "Mild (Carbon) Steel"</p><p>     Me.ComboBox1.AddItem "Stainless Steel"</p><p></p><p>     Me.ComboBox1.AddItem "Aluminum .020"</p><p>     Me.ComboBox1.AddItem "Aluminum .020"</p><p>     Me.ComboBox1.AddItem "Aluminum .020"</p><p>     Me.ComboBox1.AddItem "Aluminum .020"</p><p>     Me.ComboBox1.AddItem "Aluminum .020"</p><p>     Me.ComboBox1.AddItem "Aluminum .020"</p><p></p><p>selectedItem1 = ComboBox1.SelectedItem</p><p></p><p>For i = 0 To 8</p><p>If selectedItem1.ToString() = i Then</p><p>    MsgBox "Successful SelectedItem run test"</p><p>End If</p><p>Next i</p><p></p><p>End Sub</p>

I am having problems with line 29. I get a error as shown below.

All of the examples I've been able to find use the syntax as I've written it, at least as far as I can tell. Is this some sort of reference issue?

SolidworksApi/macros