Excel – Loading 32bit DLL using Excel 2007 (Vista 64bit version)

32-bit64-bitdllexcelvba

I discovered that I can NOT load any 32-bit DLLs using my version of Office 2007. I’m using Vista 64bit and I assume that Office is also in 64-bit mode. Is it possible to start Excel in 32-bit mode
Or
Is there a way to declare a DLL using VB to load a 32-bit DLL?

Since I don’t have the source code to some of the DLLs I am using, I can’t simply re-compile stuff for 64-bit mode. So I think my options are to force Excel to run in 32-bit mode or declare the DLL I’m using as a 32-bit DLL even though my environment is 64-bit.

The error I’m getting is “DLL not found” even though the DLL is in fact there.

Below is a sample declaration. Is there a 32-bit attribute for this statement?

Private Declare Function ESQMain Lib "ESQuotes2.dll" Alias "_ESQMain@12" _
(ByVal func As Long, ByVal ticker_symbol As String, ByVal Result As String) As Integer

Best Solution

You have a bad assumption - Office is not currently available in 64 bit. The next version of office (Office 2010) is rumored to be shipped with 32 & 64 bit.

Related Question