VB Code:
  1. Private Sub LstSites_Click()
  2. If checkfile("links.txt") = True Then
  3. Open "links.txt" For Input As #1
  4.     While Not EOF(1)
  5.         Line Input #1, strleesin
  6.         If Not strleesin = "" Then
  7.                 If InStr(1, strleesin, ",") = True Then 'Categorie gevonden
  8.                     strtemp1 = Split(strleesin, " , ")(0)
  9.                     strtemp2 = Split(strleesin, " , ")(1)
  10.                         If strtemp1 = LstSites.Text Then
  11.                             LstSites.Text = strtemp1
  12.                             LstCat.Text = strtemp2
  13.                         End If
  14.                 Else 'Geen categorie gevonden
  15.                     strtemp1 = strleesin
  16.                     strtemp2 = ""
  17.                         If strtemp1 = LstSites.Text Then
  18.                             LstSites.Text = strtemp1
  19.                             LstCat.Refresh
  20.                         End If
  21.                 End If
  22.         End If
  23.     Wend
  24. Close #1
  25. End If
  26. End Sub

Can somebody explain why he also loops the opening of the file en the filecheck procedure? It crashes and says: File already open. That's because something loops my whole sub again! I don't know how!