title: “User-defined type not defined” error in VB in Access 2007
body: <p>I'm receiving a compile error on the following line of code: </p>
  
  <pre><code>Dim oXL As Excel.Application
  </code></pre>
  
  <p>The code is in VB in MS Access 2007. The line above is the beginning of a segment to generate an MS Excel file. The obvious answer to me was to ensure that the "Microsoft Office 12.0 Object Library" is checked under Tools > References. I've done this but the error persists. Does Excel need to be installed side-by-side for this to work? What have I done wrong? Thanks in advance.</p>