I am trying to write the contents of a listbox into a text file, but I am having difficulty. The code executes error free, however at the end of it I cannot find the created text file (if it even is being created).

VB Code:
  1. Private Sub cmdTextfile_Click()
  2. Dim strFilename As String
  3. Dim intMessage As Integer
  4. Dim i As Integer
  5.  
  6.  
  7.     If lstResults.List(0) <> "" Then
  8.             strFilename = InputBox("Input filename for new output textfile", "Input Filename")
  9.             strFilename = strFilename & ".txt"
  10.             Open strFilename For Output As #1
  11.             i = 0
  12.                 Do
  13.                     Print #1, lstResults.List(i)
  14.                     i = i + 1
  15.                 Loop Until i = lstResults.ListCount + 1
  16.                
  17.             Close #1
  18.             MsgBox ("Textfile has been created")
  19.            
  20.     Else
  21.         MsgBox ("There are no output values to output to file")
  22.     End If
  23. End Sub