title: How to fix "Run-time error' 13' Type mismatch when opening a workbook
body: <p>I'm trying to open two separate workbooks via VBA in Excel and, somehow, the same code lines work in one case, but do not in the second one.</p>
  
  <p>My first code line works properly:</p>
  
  <pre><code>Set WB1 = Workbooks.Open(path &amp; fName &amp; fExt, UpdateLinks:=xlUpdateLinksNever)
  </code></pre>
  
  <p>The second one, however, do not, it does open the file, but do not store it as wb2 and returns a Mistype error.</p>
  
  <pre><code>Set WB2 = Workbooks.Open(path1 &amp; fName1 &amp; fExt1,UpdateLinks:=xlUpdateLinksNever)
  </code></pre>
  
  <p>[EDIT] This is the whole code set:</p>
  
  <pre><code>Option Explicit
  
  Sub Update_Supply_Concerns()
  
      Application.ScreenUpdating = False
      Application.EnableEvents = False
      Application.Calculation = xlCalculationManual
  
      Dim wb, WB1, WB2 As Workbooks
      Dim ws, ws1, ws2 As Worksheets
      Dim path, path1, path2 As String
      Dim fName, fName1, fName2 As String
      Dim uName As String
      Dim rDate As String
      Dim fExt, fExt1 As String
  
      uName = Environ$("username")
  
      Set wb = ActiveWorkbook
      Set ws = wb.Worksheets("Macro")
  
      With ws
          .Activate
  
          rDate = .Range("D6").Value
  
          path = "C:\Users\" &amp; uName &amp; "\Documents\Projects\" &amp; rDate &amp; "\"
          fName = "Hospital"
          fExt = ".xlsx"
          path1 = "C:\Users\" &amp; uName &amp; "\Box Sync\Supply Concerns 2.0\"
          fName1 = "Supply Concerns v2"
          fExt1 = ".xlsx"
  
          Set WB1 = Workbooks.Open(path &amp; fName &amp; fExt, UpdateLinks:=xlUpdateLinksNever)
          Set WB2 = Workbooks.Open(path1 &amp; fName1 &amp; fExt1, UpdateLinks:=xlUpdateLinksNever)
      End With
  End Sub
  
  </code></pre>
  
  <p>I've tried activating the parent workbook before attempting to open the second file, with no success.</p>
  
  <pre><code>Set WB1 = Workbooks.Open(path &amp; fName &amp; fExt, UpdateLinks:=xlUpdateLinksNever)
          wb.Activate
          Set WB2 = Workbooks.Open(path1 &amp; fName1 &amp; fExt1, UpdateLinks:=xlUpdateLinksNever)
  </code></pre>