32-bit Excel cannot find 64-bit DLL

Use this forum to post Vensim related questions.
Post Reply
devM5
Junior Member
Posts: 18
Joined: Fri Jul 03, 2020 10:41 am
Vensim version: DSS

32-bit Excel cannot find 64-bit DLL

Post by devM5 »

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

Code: Select all

Private Declare Function vensim_get_info Lib "vendll32.dll" (ByVal infowanted As Long, ByVal buf$, ByVal maxbuflen As Long) As Long
to

Code: Select all

Private Declare Function vensim_get_info Lib "vendll64.dll" (ByVal infowanted As Long, ByVal buf$, ByVal maxbuflen As Long) As Long
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:

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
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.
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: 32-bit Excel cannot find 64-bit DLL

Post by Administrator »

You cannot mix 32 and 64 bit DLLs. The only solution is to install Vensim 32 bit as well on your machine.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
devM5
Junior Member
Posts: 18
Joined: Fri Jul 03, 2020 10:41 am
Vensim version: DSS

Re: 32-bit Excel cannot find 64-bit DLL

Post by devM5 »

Ok, thank you!
Post Reply