- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I try to call fortran dllsubroutine in Excel VBA. But the VBA code stop running whenit calls the sub. There is no error message. The VBA function return #Value!
Here is my fortran code
subroutine simple(x,y)
!DEC$ ATTRIBUTES STDCALL,REFERENCE,ALIAS:'simple' :: simple
real*8 :: x,y
y=x+5.d0
end subroutine simple
Here is my VBA code
Private Declare Sub simple Lib "C:schoolsimple.dll" (x As Double, y As Double)
Function test1(a As Double) As Double
Dim b As Double
call simple(a,b)
test1=b
End Function
Could you tell me what's wrongwith my dll. Thank you very much!
Sarah
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I just solved the problem by myself.Just deletestdcall,reference in fortran code, it works smoothly now. I guess that statement just work for visual basic, not for VBA.
Thank you anyway.
Sarah
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page