Avatar of leonstryker
leonstryker
Flag for United States of America asked on

32 vs. 64 bit DLL

I have an Excel spreadsheet which access a 32 bit DLL to access external data. This DLL resides in the same directory as the spreadsheet on a network location.

The users have asked me to make this spreadsheet compatible (be useable) from both their 32 and 64 bit versions of Excel. There is a 64 bit version of the DLL available with exactly the same name as the 32 bit version.

How do I make this work?
Microsoft ExcelMicrosoft Applications

Avatar of undefined
Last Comment
leonstryker

8/22/2022 - Mon
SOLUTION
gowflow

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
leonstryker

ASKER
No, the 64 bit version does not work with 32 bit Excel. I guess that is why they sent me both .
gowflow

ok at this point I do not see what is happening in Excel and why you need a dll. Can you brief me more in details why is it that you need this dll and how you go about accessing it ? I am intrigued at this point as with all my knowledge of Excel this is the first time I see this kind of request.
gowflow
Pavel Celba

Create two subfolders (e.g. DLL32 and DLL64) and place appropriate DLLs into these subfolders. The spreadsheet then has to decide which one to use so check the OS version and then Excel version.

How to retrieve OS version:
http://www.mrexcel.com/forum/excel-questions/665816-excel-visual-basic-applications-get-version-os-computer.html

How to retrieve Excel version (derived by used VBA version):
http://msdn.microsoft.com/en-us/library/office/ff700513(v=office.11).aspx
(so you don't need OS version in fact...)
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
leonstryker

ASKER
The DLL is created and given to us by 1010Data (http://www.1010data.com/). 1010Data basically maintains a none relational database which can be used, maintained, and queried by the client (us). It can store a truly humongous amount of data. With the DLL we can query our data and benefit from their compression and querying functionality.

To access the DLL there are a bunch of Declarations such as:

Public Declare PtrSafe Sub TentenGetAPIVersion Lib "lib1010vbasdk.dll" (ByRef apiversion As String)
Public Declare PtrSafe Function TentenNewHandle Lib "lib1010vbasdk.dll" () As Long

Open in new window

Public Declare PtrSafe Sub TentenGetAPIVersion Lib "lib1010vbasdk.dll" (ByRef apiversion As String)
Public Declare PtrSafe Function TentenNewHandle Lib "lib1010vbasdk.dll" () As Long
leonstryker

ASKER
I know how to check the Excel version, but how do I point Excel to a different DLL folder?
ASKER CERTIFIED SOLUTION
Pavel Celba

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gowflow

Intersting ... but out of my league. :)
gowflow
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
leonstryker

ASKER
Renaming the DLLs actually works, so I am able to place both DLLs in the same directory and I have tested both DLLs from different versions of Excel.

The only issue I have at the moment is that Conditional Compilation, that is:

#If VBA7

is not working. Both versions seem to return nothing and the declarations are not branched.
Martin Liss

leonstryker

ASKER
My follow up question is here https://www.experts-exchange.com/questions/28316039/Comditional-compilation-for-64-bit.html

Please post there so we can continue the discussion.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy