Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Beginner
76 Views

Error with DLL Use in Excel 2019

I have used FORTRAN Composer 2013 with VS2010 to build versions of a DLL that I (and many others) have used successfully for about 5 years on machines ranging from Windows 7 with 32-bit Excel to Windows 10 with Excel 2016.  The DLL now does not work with Windows 10, Excel 2019.  Error message is Runtime Error 53, Cannot find file.  I suspect that the DLL is searching for other utilities that are not available in the W10/Excel2019 environment.  In fact, Dependency Walker shows a lot of items referenced by the DLL that it cannot find.  Is there a compiler option that I need to change (I've changed many already) that will resolve this. Or ---- is my FORTRAN or Visual Studio so outdated that I just need to upgrade. 

0 Kudos
6 Replies
Highlighted
Black Belt Retired Employee
76 Views

In Dependency Walker, please

In Dependency Walker, please do a File.. Save As to save a .dwi file. Zip that and attach the zip to a reply here. We'll look at it and give you a recommendation.

I will throw out the suggestion to make sure you are not building a Debug configuration. You can probably also fix this by setting the project property Fortran > Libraries > Use Runtime Library > Multithreaded (/MT).

--
Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
76 Views

Thanks for the quick response

Thanks for the quick response, Doc.  See attached per your request. To  answer your questions

1. This is a Release (not Debug) configuration

2. The Multithreaded /MT option is selected.  I discovered this solution to a similar problem several DLL versions ago (probably based on advice from you to another user in this forum) when one of my users had the same symptom in an earlier version of Excel.

 

0 Kudos
Highlighted
New Contributor I
76 Views

I have a few suggestions

I have a few suggestions based on my recent experience with the same problem:

1. When my new Office 365 automatically updated, the default version is 64-bit so the old 32-bit DLLs were not compatible. In Excel, check Account -> About Excel to make sure it is the version you want.
2. Build the DLL in Release mode with the options
        /iface:cvf /libs:static /threads /Qm32
3. In 64-bit mode, certain functionality that was previously offered by VBA will not work any more.

0 Kudos
Highlighted
Black Belt Retired Employee
76 Views

Thanks for the .DWI. Your DLL

Thanks for the .DWI. Your DLL is a 64-bit build. Excel typically wants 32-bit DLLs.  I checked my own copy of Office 365 Excel, based on the comment from @avinashs, and it is 32-bit. Try rebuilding as a 32-bit DLL and see if that helps.

--
Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
76 Views

Steve Lionel,     It's been

Steve Lionel,     It's been my experience so far that 64-bit Excel will not communicate with DLLs that were built for 32-bit platforms. Regardless of the Windows OS (7, 8 or 10), if the installed Excel is 32-bit then my DLL has to be built for 32-bit platform. If 64-bit Excel is installed, my DLL has to be built for 64-bit platform.  The wrinkle came when my DLL built for 64-bit platform that worked in 64-bit Excel 2016 would not work for 64-bit Excel 2019.

avinashs,      Making the change from /iface:stdref to one your suggestions of /iface:cvf  did the trick.  The DLL now runs in Excel 2019.  In all my semi-random attempts at trying compiler option changes, I did not try that one.  For the sake of completeness, the command line from the Properties/Fortran/Command Line windows is

/nologo /O2 /iface:cvf /module:"x64\Release\\" /object:"x64\Release\\" /Fd"x64\Release\vc100.pdb" /libs:static /threads /c

Dependency Walker still shows unfound files, but I don'care.  I have a DLL that now works in Excel 2019.

Many, many thanks to you.

 

0 Kudos
Highlighted
Black Belt Retired Employee
76 Views

It was not clear to me that

It was not clear to me that you had a 64-bit Excel.

I also had assumed that you used the same build options as before. For x64, the main difference between /iface:cvf and /iface:stdref is that the former upcases the Fortran routine name and the latter downcases it. X64 doesn't have STDCALL as a calling convention, but other actions of these options do have effect.

--
Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos