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

CVF dll (for Excel) subroutine name limitations

tom_kreutz
Beginner
706 Views
I've created a Fortran dll (via CVF) to use with Excel. The Fortran subroutine name is HSMR4_MEM12(), and I make it available via:
!DEC$ ATTRIBUTES DLLEXPORT :: HSMR4_MEM12

I find that the name HSMR4b_MEM12() (one more character)does NOT work, nor does HSMR4bMEM12() (same number of characters). Any idea why? Limitations on the length of:

- CVF subroutine name?
- VBA subroutine name?
- subroutine name within Excel VB?

Not a big deal, but I wasted an amazing amount of time tracking this one down!

Thanks,

Tom Kreutz
0 Kudos
3 Replies
Jugoslav_Dujic
Valued Contributor II
706 Views
No small length limitations that I know of (could be around 32 characters for some uses, but you're nowhere near). The problem lies elsewhere. Why did you attribute the problem to name length? What does dumpbin /exports yourdll.dll give?

Jugoslav


0 Kudos
durisinm
Novice
706 Views
I must be missing something obvious here. Why does your second paragraph contain the extra letter b in the name?

Both Fortran and Excel VBA have alias statements that will allow you to adjust the recognized name of the DLL.

Mike
0 Kudos
tom_kreutz
Beginner
706 Views
Dear Jugoslav and Mike,

Thanks for your help. DUMPBIN.EXE reveals that when I used a lower case "b" in the subroutine name, the DLL's internals revealed it as an upper case "B" in the name. Apparently, Excel VB is sensitive to case, for when I changed the declaration in my Excel macro to an upper case "B", it worked perfectly.

(Mike, I was trying to add the "b" - unsuccessfully - into name HSMR_MEM12 in order to distinguish it from its predecessor dll.)

So, what I thought was some sort of character limitation issue was simply a case mismatch, presumably induced by Fortran's case insensitivity (or conversion to upper case, in this case).

Thanks very much.

Tom
0 Kudos
Reply