32-bit Excel cannot find 64-bit DLL
Posted: Mon Jul 19, 2021 12:43 pm
I am trying to get the DLL-examples delivered with Vensim 8.2.1 (64-bit) to run in Microsoft Excel 2016 (32-bit).
The example I am using is C:\Users\Public\Vensim\DLL\excel97\VENDLL.XLS
When I run the "Get Vensim Info"-macro, Excel is returning a runtime error errorcode 53 - vendll32.dll not found as expected, since the 32-bit-DLL is not installed in C:\Windows\SysWOW64 folder with 64-bit Vensim.
So I changed the function declarations to call the 64-bit DLL from
to
However, I still get the same runtime error for the 64-bit DLL: errorcode 53 - vendll64.dll not found. The file exists in C:\Windows\System32 though, even if I call the DLL with its full path:
Is there any solution to fix this error? I can successfully call the DLL from a C# app which is built in 64-bit, which makes me think the error is coming from 32-bit Excel not being able to call a 64-bit DLL.
The example I am using is C:\Users\Public\Vensim\DLL\excel97\VENDLL.XLS
When I run the "Get Vensim Info"-macro, Excel is returning a runtime error errorcode 53 - vendll32.dll not found as expected, since the 32-bit-DLL is not installed in C:\Windows\SysWOW64 folder with 64-bit Vensim.
So I changed the function declarations to call the 64-bit DLL from
Code: Select all
Private Declare Function vensim_get_info Lib "vendll32.dll" (ByVal infowanted As Long, ByVal buf$, ByVal maxbuflen As Long) As Long
Code: Select all
Private Declare Function vensim_get_info Lib "vendll64.dll" (ByVal infowanted As Long, ByVal buf$, ByVal maxbuflen As Long) As Long
Code: Select all
Private Declare Function vensim_get_info Lib "C:\Windows\System32\vendll64.dll" (ByVal infowanted As Long, ByVal buf$, ByVal maxbuflen As Long) As Long