title: Excel 2007 VBA Macro reading a text file line by line how do I stop delimiting on a comma (,)
body: <p>I have a simple Excel 2007 Macro that is reading a text file line by line and displaying the output. </p>
  
  <p>This macro is breaking on commas. I want it to simply read the entire line breaking on a carrage return. </p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>Sub Directory()
    Dim strFileName As String
    Dim strDirectory As String
    Dim intFileKey As Integer
    Dim strLine As String
  
    strDirectory = "C:\Documents and Settings\e1009028\My Documents\embosstest"
  
    ChDir (strDirectory)
  
    strFileName = Dir("*.txt")
  
    Do While Len(strFileName) &gt; 0
      intFileKey = FreeFile
      Open strFileName For Input As intFileKey
      Do While Not EOF(intFileKey)
          Input #intFileKey, strLine
          MsgBox Mid(strLine, 1, 10)
      Loop
      strFileName = Dir
    Loop
  
  End Sub
  </code></pre>
  
  <p>Here is a sample text file:</p>
  
  <pre><code>1 blahblahblabh
  2 blah,blahblah
  </code></pre>