Index out of range error

Feb 1, 2015 at 7:04 AM
When using the following code to delete an entry from the users phonebook the following error occurs:
Index out of range. It must be a negative value and small size of the collection. Parameter name : index
The entry will be deleted yet the error still occurs.
Note: the phonebook is open at the time this code runs.
```
Private Sub DeleteVpnButton_Click(sender As Object, e As EventArgs) Handles DeleteVpnButton.Click
    Try
        Me.PhoneBook.Open(PhoneBook.GetPhoneBookPath(RasPhoneBookType.User))
    Catch ex As Exception
        Me.StatusTextBox.AppendText(err.Description.ToString & vbNewLine)
    End Try
    Try
        If Me.PhoneBook.Entries.Contains("NetFree VPN") Then
            Me.PhoneBook.Entries.Remove("NetFree VPN")
        End If 
    Catch ex As Exception
        Me.StatusTextBox.AppendText(err.Description.ToString & vbNewLine)
    End Try
End Sub
```