Solved

32 vs. 64 bit DLL

Posted on 2013-12-11
11
338 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 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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 47

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

726 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