- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have created a fortran dll using Intel Visual Fortran in VS 2008. I run this dll from excel in a VBA macro. The macro runs fine on my computer, but as soon as I try to run it on other computers in the office, excel throws and error saying it can't find the .dll file. I checked the system log where it said that it failed to find a VS 2008 library during runtime. I would like to make the .dll independent of VS 2008, which I thought it would be already. Is there a compiler setting I missed in order to keep the .dll from using system libraries? Any help would be appreciated!
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to link against static libraries when you build the DLL. So use the "Multithreaded" Runtime Library option under Fortran / Libraries.
Also, are you using an Excel Add-In in your Workbook to link to the DLL? If so, Excel puts a hidden path into your workbook which links to this Add-In. This path includes your userid, and so does not work on another computer or for another user. I have found it useful to put the Add-In into XLSTART instead of into the Add-Ins folder, as this does not demonstrate the same issue. I consider this a bug with the Excel Add-Ins system, but don't hold your breath for it to be fixed.
Regards,
David
Also, are you using an Excel Add-In in your Workbook to link to the DLL? If so, Excel puts a hidden path into your workbook which links to this Add-In. This path includes your userid, and so does not work on another computer or for another user. I have found it useful to put the Add-In into XLSTART instead of into the Add-Ins folder, as this does not demonstrate the same issue. I consider this a bug with the Excel Add-Ins system, but don't hold your breath for it to be fixed.
Regards,
David
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to link against static libraries when you build the DLL. So use the "Multithreaded" Runtime Library option under Fortran / Libraries.
Also, are you using an Excel Add-In in your Workbook to link to the DLL? If so, Excel puts a hidden path into your workbook which links to this Add-In. This path includes your userid, and so does not work on another computer or for another user. I have found it useful to put the Add-In into XLSTART instead of into the Add-Ins folder, as this does not demonstrate the same issue. I consider this a bug with the Excel Add-Ins system, but don't hold your breath for it to be fixed.
Regards,
David
Also, are you using an Excel Add-In in your Workbook to link to the DLL? If so, Excel puts a hidden path into your workbook which links to this Add-In. This path includes your userid, and so does not work on another computer or for another user. I have found it useful to put the Add-In into XLSTART instead of into the Add-Ins folder, as this does not demonstrate the same issue. I consider this a bug with the Excel Add-Ins system, but don't hold your breath for it to be fixed.
Regards,
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The first suggestion seems to work, thanks a bunch!
Also, the dll is not an add-in. I'm just using the 'Lib' keyword to create a subroutine out of it.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page