title: Why doesn't code work in VB.net, but works in VBA; GetObject
body: <p>VBA code works great:</p>
  
  <pre><code>Sub testVBA()
  
      Dim wb As Object ' Lotus123.Document
      Set wb = GetObject("S:\Temp\T\0375D.WK3", "Lotus123.Workbook")
  
  End Sub
  </code></pre>
  
  <p>VB.net code fails:</p>
  
  <pre><code>Sub TestVBNet()
  
      Dim wb As Object ' Lotus123.Document
      wb = GetObject("S:\Temp\T\0375D.WK3", "Lotus123.Workbook")
  
  End Sub
  </code></pre>
  
  <p>In VB.net I get a FileNotFoundException: "File name or class name not found during Automation operation."</p>
  
  <p>As I can run it from VBA that means the file exists and that the class name exists. So why doesn't it work and how can I fix it in VB.net.</p>
  
  <p>EDIT: I guess I'm not sure how to start diagnosing this: Obviously the class exists on my computer but somehow VB.net doesn't manage to find it. Maybe VB.net uses a different method to activate the class. Maybe a registry entry is missing. I am glad for any suggestions.</p>
  
  <p>Edit 2: I also tried using CreateObject and got this error: "Cannot create ActiveX component." Not unexpected.</p>