Loading a 32-bit DLL using Excel 2007 (Vista 64-bit version)
I found that I can NOT load 32-bit DLLs using my Office 2007 version. I am using Vista 64bit and I am assuming Office is also in 64-bit mode. Can Excel run in 32-bit mode? Or is there a way to declare the DLL using VB to load a 32-bit DLL?
Since I do not have the source code for some of the DLLs that I use, I cannot simply recompile the stuff for 64-bit. So I think my options are to get Excel to run in 32 bit mode or declare a DLL Im using as a 32 bit DLL even though my environment is 64 bit.
The error Im get "DLL not found" even though the DLL is actually there.
Below is an example of a declaration. Is there a 32-bit attribute for this operator?
Private declaration function ESQMain Lib "ESQuotes2.dll" Alias "_ESQMain @ 12" _ (ByVal func As Long, ByVal ticker_symbol As String, ByVal Result As String) As Integer
You cannot "declare" a 32 bit DLL. It is either Win32 binary or Win64 binary. The first kind of binary can be loaded into Win32 processes, the second one can be loaded into Win64 processes. You cannot mix them. Visual Basic import attributes don't help.
So your only option is to run a 32 bit Excel binary. It should exist, obviously, since Office is still available for Vista 32, but the question is whether it is installed and where.
source to share