views:

673

answers:

2

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

A: 

You can't "declare" a DLL to be 32 bits. It's either a Win32 binary or a Win64 binary. The first kind of binary can be loaded in Win32 processes, the second in Win64 processes. You can't mix them. Attributes on the Visual Basic import do not help.

So, your only option is to start the 32 bits Excel binary. It has to exist, obviously, since Office is still available for Vista 32, but the question is whether it's installed and where.

MSalters
There is no 64 bit Excel, he is running 32 bit Excel.
JonnyBoats
You are correct. My mistake. There is no 32bit version of Excel so my question is wrong. I read articles talking about 32bit vs. 64 bit DLL problems and it sounded like this was my issue.
Jerry
+2  A: 

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.

JonnyBoats