Making Fortran DLLs to interface with VBA in Excel

Note to self, Remember:
  • When working with Intel visual fortran, always perform a static link (/MT) in the command line options so that you don’t dependent on a DLL being present on the target machine.
  • DLLs need Kernel32.lib to be added to the dependencies
  • ByVal in VBA doesn’t always mean ByVal, when calling a DLL it means “Copy then give a Ref”, so on the Fortran side, get the address by reference.