?
Solved

32 vs. 64 bit DLL

Posted on 2013-12-11
11
Medium Priority
?
349 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 31

Assisted Solution

by:gowflow
gowflow earned 1000 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 31

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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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 1000 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 31

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 49

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

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

765 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