title: VBA_String cannot be added into array(Error: Expected array)
body: <p>Good afternoon,</p>
  
  <p>I'd like to add a long string, such as "OA_OB_OC_OD_n1" into an array. Then use the function Split to seperate it into several parts and put them into my sheet, like:
  OA|OB|OC|OD|n1|</p>
  
  <p>Here is my code (all the Dim have been done):</p>
  
  <p>Public Sub Boutton_Importer_Click()</p>
  
  <pre><code>list_de_controle = "TEXT;" &amp; listPath
  Open listPath For Input As #1  
  'to read a list which contains the name of files I want to open
  
  Do While Not EOF(1)
      Line Input #1, nom_de_Fich  'read the name of file
      WrdArray() = Split(nom_de_Fich, "_")  'here is the problem
  
      For Each wrd In WrdArray()
          ActiveCell.Value = wrd
          ActiveCell.Offset(0, 1).Select
      Next wrd
  
      Open nom_de_Fich For Input As #2  'open the file
      Insérer_contenu  'I have a function here to read the contents
      Close #2
  
      ActiveCell.Offset(1, 0).Select
      ActiveCell.End(xlToLeft).Select
  Loop
  Close #1
  </code></pre>
  
  <p>End Sub</p>
  
  <p>If I change this part:</p>
  
  <pre><code>Line Input #1, nom_de_Fich  'read the name of file
  WrdArray() = Split(nom_de_Fich, "_")  'here is the problem
  
  For Each wrd In WrdArray()
      ActiveCell.Value = wrd
      ActiveCell.Offset(0, 1).Select
  Next wrd
  </code></pre>
  
  <p>into:</p>
  
  <pre><code>Line Input #1, nom_de_Fich  'read the name of file
  ActiveCell.Value = nom_de_Fich
  ActiveCell.Offset(0, 1).Select
  </code></pre>
  
  <p>That works well. So i don't know how to fix that.
  Thank you in advance!</p>