title: Error importing and exporting excel data to vb.net, "Microsoft.Office.Interop.Excel.Application is not defined"
body: <p>I am trying to run a file I downloaded to import and export data from excel. 
  I downloaded from from the following site:</p>
  
  <p><a href="http://www.sattsoft.com/sourcecodes/details/1/9/import-export-data-to-excel-using-vb-net.html" rel="noreferrer">http://www.sattsoft.com/sourcecodes/details/1/9/import-export-data-to-excel-using-vb-net.html</a></p>
  
  <p><strong>When I run the file the error comes on the following lines</strong></p>
  
  <pre><code>    Dim xlApp As Microsoft.Office.Interop.Excel.Application
      Dim xlBook As Microsoft.Office.Interop.Excel.Workbook
      Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet
  </code></pre>
  
  <p><strong>These are the errors that come on those respective lines</strong></p>
  
  <p>Type "Microsoft.Office.Interop.Excel.Application is not defined"</p>
  
  <p>Type "Microsoft.Office.Interop.Excel.Workbook is not defined"</p>
  
  <p>Type "Microsoft.Office.Interop.Excel.Worksheet is not defined"</p>
  
  <p>What I want to do is to run the file without the errors so that I can import and export data from excel to vb.net datagridview.
  I am using Excel 2010 and visual studio 2010</p>
  
  <p>How do I get around this error so I can run the file?</p>