title: Use VisualBasic DLLs in Java
body: <p>I have to access VBA-code of Office applications from my Java application, I found <a href="https://stackoverflow.com/questions/6833588/calling-vba-code-from-java">THIS</a> that says I can access VBA-code through VisualBasic DLLs using JNI. I don't want to use a COM-bridge if not necessary, I'd rather go with a DLL-solution.
  I created a VisualBasic Class Library in Visual Studio 2013 (a simple example to test if it works):</p>
  
  <pre><code>Public Class Test1
      Public Function box()
          MsgBox("boxtest!")
      End Function
  End Class
  </code></pre>
  
  <p>I built is as a release and put this in my Java project:</p>
  
  <pre><code>public class Test1 {
      static{
          System.loadLibrary("Test1");
      }
      public native void box(); 
  }
  </code></pre>
  
  <p>The function is being called by <code>new Test1().box();</code>.</p>
  
  <p>I receive the following exception: <code>Exception in thread "main" java.lang.UnsatisfiedLinkError: test.Test1.box()V</code></p>
  
  <p>I also used JNA to access the DLL but after hours of trying I couldn't get it to work (I also read that it can't be used with VisualBasic DLLs).
  I set the Native Library Folder of my src Folder to to folder containing the DLL.</p>
  
  <p><strong>question:</strong> Can I use VisualBasic DLLs in Java, if yes, with JNA or JNI (or both) and if so what did I do wrong, how can I access the function properly? (I guess the rest with returning and parameters is easy then...)</p>
  
  <p>Thank you very much in advance and merry christmas to you all! :)</p>