title: Why do I get "not defined" on all the Excel objects even after importing Microsoft.Office.Interop.Excel (VB.NET)?
body: <p>I've got this code:</p>
  
  <p>Imports Excel = Microsoft.Office.Interop.Excel</p>
  
  <p>Public Class FormExcelTest_VB   </p>
  
  <pre><code>Private Sub ButtonCreateExcelFile_Click( sender As Object,  e As EventArgs) Handles ButtonCreateExcelFile.Click
      Dim xlApp As New Excel.Application
      Dim xlWorkBook As Excel.Workbook
      Dim xlWorkSheet As Excel.Worksheet
      . . .
  </code></pre>
  
  <p>I got it from <a href="https://stackoverflow.com/questions/33264298/winforms-com-exception-opening-excel-workbook/33264744#33264744">here</a>.</p>
  
  <p>It doesn't compile, though; I get:</p>
  
  <pre><code>Type 'Excel.Application' is not defined.
  Type 'Excel.Workbook' is not defined.
  Type 'Excel.Worksheet' is not defined.
  </code></pre>
  
  <p>Being unfamiliar with VB[.NET], I thought to myself, "<em>Self, you probably forgot to add a required reference.</em>" But then I saw that there is no "References" folder in Solution Explorer for the project (coming from the land of C#, that seems awfully strange to me).</p>
  
  <p>The "helpful" msgs I get when hovering over the rejected code are:</p>
  
  <p><a href="https://i.stack.imgur.com/FaboB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FaboB.png" alt="enter image description here"></a></p>
  
  <p>The first one doesn't seem the likely remedy, and the following ones even less so. How am I supposed to know how to resolve (no pun intended) these undefined types?</p>