Although I am a fairly experienced Fortran programmer, I have little or no idea about how to create a Fortran DLL that can be subsequently used in MS Excel. Browsing the DVF and Excel documentation also doesn't seem to get me anywhere, so I hope that one of you will be able to point me in the right direction.
For the sake of discussion, suppose I want to create a library with my own Fortran functions and make it available within Excel. In fact, let's assume the library will contain only two simple functions, say:
Real Function MySub1 (a, b, c)
Real, Intent (IN) :: a, b, c
Real :: MySub2
MySub1 = a + MySub2 (b, c)
End Function MySub1
Real Function MySub2 (b, c)
Real, Intent (IN) :: b, c
MySub2 = b * c
End Function MySub2
My questions are as follows:
1) How do I go about creating the DLL? Is it as simple as creating a new DLL project in DVF and then compiling and linking? Or do I need to take any special measures.
2) Once the DLL has been successfully created, how can I make it available for use in MS Excel, so that, for example, I can use formulas like "=MySub1(A1,A2,A3)" or "=MySub2(B1,B2)" in a spreadsheet cell?
Thanks in advance for your feedback!