Solved

32 vs. 64 bit DLL

Posted on 2013-12-11
11
330 Views
Last Modified: 2013-12-11
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?
0
Comment
Question by:leonstryker
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 29

Assisted Solution

by:gowflow
gowflow earned 250 total points
ID: 39711695
I guess you would rename the 32 bit version to .old and put the 64 there as presume 64 supports 32 and 64  !!! but u need to try that first.
gowflow
0
 
LVL 29

Author Comment

by:leonstryker
ID: 39711703
No, the 64 bit version does not work with 32 bit Excel. I guess that is why they sent me both .
0
 
LVL 29

Expert Comment

by:gowflow
ID: 39711718
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
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 42

Expert Comment

by:pcelba
ID: 39711748
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...)
0
 
LVL 29

Author Comment

by:leonstryker
ID: 39711755
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
0
 
LVL 29

Author Comment

by:leonstryker
ID: 39711763
I know how to check the Excel version, but how do I point Excel to a different DLL folder?
0
 
LVL 42

Accepted Solution

by:
pcelba earned 250 total points
ID: 39711786
So if the Excel does not support path in dll name:
Public Declare PtrSafe Function TentenNewHandle Lib "YOURSUBFOLDER\lib1010vbasdk.dll" () As Long

then you can rename one DLL:

Public Declare PtrSafe Function TentenNewHandle Lib "lib1010vbasdk_64.dll" () As Long
0
 
LVL 29

Expert Comment

by:gowflow
ID: 39711956
Intersting ... but out of my league. :)
gowflow
0
 
LVL 29

Author Closing Comment

by:leonstryker
ID: 39712288
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.
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39712342
0
 
LVL 29

Author Comment

by:leonstryker
ID: 39712371
My follow up question is here http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_28316039.html

Please post there so we can continue the discussion.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question