title: Declaring variable workbook / Worksheet vba
body: <p>I know this might come off as a trivial question, but I can't seem to declare a <code>workbook</code> or a <code>worksheet</code> as a variable in <code>VBA</code>. I have the following code, but I can't figure out what I am doing wrong, it should be straight forward. Normally I don't have any problems declaring variables such as <code>Dim i As Integer</code> etc. </p>
  
  <pre><code>sub kl() 
  
      Dim wb As Workbook
      Dim ws As Worksheet
  
      Set wb = ActiveWorkbook
      Set ws = Sheet("name")
  
      wb.ws.Select
  
  End Sub
  </code></pre>
  
  <p>When I run the above code, I receive a <code>type missmatch</code> error.</p>