title: Create Word documents based on cell values throws Subscript error
body: <p>I want to create a copy of a Word file using the value of each cell in a range as the file name. The file name is each Monday of the year.</p>
  <p>I'm getting an</p>
  <blockquote>
  <p>Error 9: Subscript out of Range</p>
  </blockquote>
  <p>The path and filename are valid. Should I approach this task a different way?</p>
  <pre class="lang-vb prettyprint-override"><code>Sub batch_minutesbuilder()
      On Error GoTo errHndl
      Dim wb As Workbook
      Dim ws As Worksheet
  
      'word declaration
      Dim wdApp As Word.Application
      Dim wdDoc As Word.document
      Dim sel As Word.Selection
  
      'set the excel workbook and worksheets
      Set wb = ThisWorkbook
      Set ws = wb.Worksheets(&quot;MinutesTemplate&quot;)
  
      Dim fso As Object
      'Dim fld As Folder
      Dim sourcePath As String, destPath As String
      Dim sourceFile As String, destFile As String, sourceExtension As String
      Dim rng As Range, cell As Range, row As Range
          
      Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)
      ' Set rng = ThisWorkbook.ActiveSheet.Range(&quot;D2&quot;, &quot;D53&quot;)
      Set rng = ws.Range(&quot;D2:D53&quot;).Value
      
      'Uncomment for testing
      MsgBox rng
      
      sourcePath = &quot;C:\SLC\&quot;
      
      'Uncomment for testing
      MsgBox sourcePath
      
      destPath = &quot;C:\SLC\&quot;
      
      'Uncomment for testing
      MsgBox destPath
      
      sourceFile = &quot;MinTemplate.docx&quot;
      
      'Uncomment for testing
      MsgBox sourceFile
      
      destFile = &quot;&quot;    
   
      For Each row In rng.Rows
          sourceExtension = VBA.Split(VBA.Trim(row.Cells(, 2)), &quot;.&quot;)(1)
          MsgBox sourceExtension
          sourceFile = sourcePath &amp; &quot;MinTemplate.docx&quot;
          MsgBox sourceFile
          
          destFile = destPath &amp; VBA.Trim(row.Cells(, 1)) &amp; &quot;.&quot; &amp; sourceExtension
          MsgBox destFile
          
          fso.CopyFile sourceFile, destFile, False
      Next row
      
      MsgBox &quot;Yay! Operation was successful.&quot;, vbOKOnly + vbInformation, &quot;Done&quot;
      Exit Sub
   
  errHndl:
      MsgBox &quot;Error happened while working on: &quot; + vbCrLf + _
      sourceFile + vbCrLf + vbCrLf + &quot;Error &quot; + _
      Str(Err.Number) + &quot;: &quot; + Err.Description, vbCritical + vbOKOnly, &quot;Error&quot;
   
  End Sub
  </code></pre>