Solved

32 vs. 64 bit DLL

Posted on 2013-12-11
11
314 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
 
LVL 41

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
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.

 
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 41

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now