2
votes

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

2
This question is bad. I did discover that there is no 64bit version of office, so my real problem is that Excel simply will not load or can not find my DLL no matter where I put it.Jerry
The answer turned out to be that Excel 2007 looks in different places for the DLL now. I discovered this by downloading sysinternals process monitor and noticed that it doesn't look in the same folder as the workbook and no longer searches in windows\system32 either.Jerry

2 Answers

2
votes

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.

0
votes

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.