Platform: WinXP SP2, Intel Fortran 11, Excel 2007
I'm having trouble connecting a dll file with excel.
The dll file is relatively simple:
subroutine FortranCall (r1, num)
!DEC$ ATTRIBUTES DLLEXPORT, STDCALL, REFERENCE, ALIAS:"FortranCall" :: FortranCall
integer, intent(in) :: r1
character(10), intent(out) :: num
!DEC$ ATTRIBUTES REFERENCE :: num
num = ''
write (num,'(i0)') r1 * 2
return
end subroutine FortranCall
build with: ifort /nologo /dll Fcall.f90, and after that copied to "temp" directory on C drive (how does one write a backslash in here, anyway (except copy/pasting) ?)
and I have an Excel file with, in Sheet1:
Private Sub CommandButton1_Click()
Dim r1 As Long
Dim num As String * 10
r1 = 123
Call FortranCall(r1, num)
TextBox1.Text = "Answer is " & num
End Sub
and in Moduel1:
Declare Sub FortranCall Lib "C:\temp\Fcall.dll" (r1 As Long, ByVal num As String)
When ran it reports an error: runtime error 53, file not found c:\temp\fcall.dll
Anyone has any clue what could be wrong ?