title: Setting Found/Open Workbook(s)
body: <p><strong>Problem:</strong> I can't set a found/open workbook</p>
  
  <p><strong>Code:</strong> Below is my code.  My error is on line <code>Set wkbTemp = wkbTempStr</code> error <code>Type Mismatch</code>.</p>
  
  <p>I have tried a few variations, done some searching but turning up blanks.. Any help would be appreciated.</p>
  
  <pre><code>Sub Test_wkb()
  
      Dim wbcount As Integer
      wbcount = Workbooks.Count
  
      For i = 1 To wbcount
          wkb = Workbooks(i).Path &amp; "\" &amp; Workbooks(i).Name
      Debug.Print wkb
      Next
  
      Dim wkbTempStr As String
      Dim wkbTemp As Workbook
      Dim wksTemp As Worksheet
  
      wkbTempStr = "C:\Users\JohnDoe\Desktop\Consolidate Macro.xlsm"
  
      Set wkbTemp = wkbTempStr
      Set wksTemp = wkbTemp.Sheets("Pay")
  
      'just seeing if code works below
      wksTemp.Range("I18") = "This works"
  
  End Sub
  </code></pre>