title: How do I call VBA code in an Excel spreadsheet from Java?
body: <p>I have an Excel file with a large set of VBA code.  There are 4 public subroutines that take no parameters that can be called by the user when the document is opened in Excel, these manipulate the data in the various sheets as needed.  We have a large Java application that we would like to interact with this document by calling the Macros from the Java environment.  The point is that we only have to write the VBA code once and then Java can call it for execution.  Furthermore, we want to assume that the user of the Java application does not necessarily have immediate access to Excel, but is operating on a Windows machine.  How should one go about doing this?</p>
  <p>Do we compile the VBA code into a DLL, and call it from within Java?  How do you compile the DLL, does that require the use of Visual Studio?  How do we call the DLL from Java?  Should we try some sort of COM object?</p>