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

VBA calling fortran .dll

sbenati
Beginner
631 Views
Hi, I have the following problem.

I have a .dll that is called from Excel 98, through
VBA and the appropriate calling convention. Everything
is OK.

If I move "mycode.xls" with its "my.dll" to another PC
with Excel 98, everything is OK.

When I move "mycode.xls" with its "my.dll" to another PC with Excel 2000, the macro does not work anymore:
Excel simply crashes.

Apparently (that is: checking and reading the Microsoft tech support), it is due to the fact that Excel 2000 does not support anymore the possibility to make a statement like "CALL MYROUTINE(...)" to a user-defined .dll. Only subroutine that are contained in Excell add-ins "my.xll" can be called.

Am I right with this conclusion? Or there is a new way
to make excell 2000 calling "my.dll"? Is there the possibility
of compiling a "my.xll" with some fortran compiler?

All the best to everybody, Stefano
0 Kudos
2 Replies
durisinm
Novice
631 Views
What Microsoft technical support did you read? Calling Fortran DLLs from Excel 2000 and 2002 should work as long as you have the proper Declare Function statement in your Excel VBA code and you also have the DLL file in a place where Windows will find it when you run Excel. That place is usually in the same directory with the Excel workbook that's making the call to the DLL.

Mike
0 Kudos
sbenati
Beginner
631 Views
Unfortunately the document that I have at hand is written in Italian. It mentions "Excel CALL vulnerability", but I did not find anything about it in the Microsoft Office home page to show to the people of the forum.

If I read the document more carefully, it can reefer to a ".dll" Call from a cell of the worksheet, not from a VBA module. So, at least dll functions can be used in Excel 2000 and 2002.

In any case, I don't think that my problem comes from a path specification: everything is in the "a:..." directory, but the code works for some Excel version, while for others version Excel crashes without any warning like "..Cannot find ...".

If some of you has any idea...

All the best, Stefano
0 Kudos
Reply