title: This code to remove listbox duplicate items gives me an error
body: <pre><code> Private Sub CHKDUP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CHKDUP.Click
  
          Dim i As Long
          Dim j As Long
          With GlinkList
              For i = 0 To GlinkList.Items.Count - 1
                  For j = GlinkList.Items.Count To (i + 1) Step -1
                      If GlinkList.Items(j) = GlinkList.Items(i) Then
                          GlinkList.Items.Remove(j)
                      End If
                  Next
              Next
          End With
  
      End Sub
  </code></pre>
  
  <p>When I press the button, it gives me 'Unhandeled exception has occurred in your applcation, InvalidArgument=Value of '975&lt;-Listbox I tems' is not valid for 'index'. Parameter name: index</p>