title: Ref workbook by path and name - VBA
body: <pre><code>Sub Quack()
  
  Dim LookupWB As Workbook
  Set LookupWB = Application.Workbooks("C:\Users\user1\Desktop\Book1.xlsx")
  
  End Sub
  </code></pre>
  
  <p>This code gives an error: </p>
  
  <blockquote>
    <p>Subscript out of range
    I think it's because of the "Set" line. 
    How do you correctly reference a workbook by path?</p>
  </blockquote>
  
  <p>If I write: <code>Set LookupWB = Application.Workbooks("Book1.xlsx")</code> (without full path) it work perfectly.
  Thanks a lot!</p>