Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Calling a Fortran DLL in VBA

Roman2
Beginner
892 Views
Hi
I'm new to both... Fortran and VB / VBA ... and I have a simple question... is it possible to call a Fortran DLL from VBA?
I try to get data out of Excel and do the calculation in Fortran... which sends the information back to VBA in order to save it in the Excel file...

Is what I try to do even possible? I read a lot about calling Fortran DLLs in VB Code... but never about calling it in VBA.

Thanks a lot for your help

Greetings
0 Kudos
5 Replies
anthonyrichards
New Contributor III
892 Views
This problem has arisen so often here thata simple search of the forum for 'EXCEL Fortran DLL' should throw up lots of helpful links for you.

0 Kudos
Roman2
Beginner
892 Views

hehe okay... sorry about that :)

0 Kudos
DavidWhite
Valued Contributor II
892 Views
Quoting - Roman

hehe okay... sorry about that :)

Among the threads you may find, this one may be useful.

I recommend that you get dependency walker (free from dependencywalker.com) to help sort out missing DLL's and errors that occur from time to time. Getting the argumnet types and calling conventions on both sides of the call is critical.

I have at least 3 apps running with multiple users all from Excel through VBA to Fortran DLL. If you want any assistance - search the forum and ask for help.

Regards,

David
0 Kudos
anthonyrichards
New Contributor III
892 Views

I attach the zipped archive mentioned there, with two added screenshots showing the EXCEL worksheet plus VBA code.
0 Kudos
Roman2
Beginner
892 Views
well thanks for the help @ all :) I will try it

greez

0 Kudos
Reply