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
Solved

Comditional compilation for 64 bit

Posted on 2013-12-11
4
213 Views
Last Modified: 2013-12-11
This is a followup to my previous question http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_28315813.html

Apparently the compilation constant (VBA7) is not working for me as the the branching is always directed to the true part of the statement:
#If VBA7 Then
Public Declare PtrSafe Sub TentenInit Lib "lib1010vbasdk_64.dll" ()
#Else
Public Declare PtrSafe Sub TentenInit Lib "lib1010vbasdk_32.dll" ()
#End If

Open in new window

0
Comment
Question by:leonstryker
  • 2
  • 2
4 Comments
 
LVL 42

Expert Comment

by:pcelba
ID: 39712387
Did you try Win64 instead of VBA7 ?  Win64 should distinguish between Office 32/64. VBA7 distinguishes between 2010 and earlier versions.

But I am a little bit skeptic if the following paragraph is true:
Compile time constants should be evaluated during the compile time so the result depends on the environment used during compilation and you cannot affect the program behavior at run-time this way...
0
 
LVL 29

Author Comment

by:leonstryker
ID: 39712420
Well, the Windows version will always be 64, since you can install either 32 or 64 bit Office on that, and you can not install 64 bit office on a 64 bit Windows.
0
 
LVL 42

Accepted Solution

by:
pcelba earned 500 total points
ID: 39712440
Yes but the Win64 constant does not point to Windows 64. It  should distinguish between Office 32/64 bit

A small typo fix:  You CAN install 64 bit office on a 64 bit Windows. :-)
0
 
LVL 29

Author Closing Comment

by:leonstryker
ID: 39712452
Tried it before and it did not work, but this time I restarted Excel and it worked on both versions. Thank you :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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,…
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)…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

860 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