ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional compiling between Excel Versions (https://www.excelbanter.com/excel-programming/354977-conditional-compiling-between-excel-versions.html)

Ken Soenen

Conditional compiling between Excel Versions
 
The program that I am writing using Excel 2003 is spread over many modules
and is not totally compatible with Excel 2000. I get compiler errors in many
modules. My question is: how is this normally handled? I can use the
compiler constants #Const and its associated #IF statement to conditionally
compile certain pieces of code, but the Constant has to be defined in EVERY
module that you're going to use it in and then has to be manually changed
when you get the code over to the destination machine(Excel Version). It all
seems pretty cumbersome to me. Am I missing something here?? Other than a
few brain cells!!!



thanks,

ken



Thomas Ramel

Conditional compiling between Excel Versions
 
Grüezi Ken

Ken Soenen schrieb am 03.03.2006

The program that I am writing using Excel 2003 is spread over many modules
and is not totally compatible with Excel 2000. I get compiler errors in many
modules. My question is: how is this normally handled? I can use the
compiler constants #Const and its associated #IF statement to conditionally
compile certain pieces of code, but the Constant has to be defined in EVERY
module that you're going to use it in and then has to be manually changed
when you get the code over to the destination machine(Excel Version). It all
seems pretty cumbersome to me. Am I missing something here?? Other than a
few brain cells!!!


You could use 'Applicaion.Version' to find out which verion of Excel is
running.
In an If-statemend you have the diffenrent code for each version.



Regards
Thomas Ramel

--
- MVP for Microsoft-Excel -
[Win XP Pro SP-2 / xl2000 SP-3]
Microsoft Excel - Die ExpertenTipps:
(http://tinyurl.com/9ov3l und http://tinyurl.com/cmned)

Norman Jones

Conditional compiling between Excel Versions
 
Hi Ken,

The conventional advice would be to develop the application in the lowest
version which, it is anticipated, it will be used.

This does not preclude the possible use of conditional compilation to
provide additional functionality to users of later versions.


---
Regards,
Norman



"Ken Soenen" wrote in message
...
The program that I am writing using Excel 2003 is spread over many modules
and is not totally compatible with Excel 2000. I get compiler errors in
many modules. My question is: how is this normally handled? I can use the
compiler constants #Const and its associated #IF statement to
conditionally compile certain pieces of code, but the Constant has to be
defined in EVERY module that you're going to use it in and then has to be
manually changed when you get the code over to the destination
machine(Excel Version). It all seems pretty cumbersome to me. Am I missing
something here?? Other than a few brain cells!!!



thanks,

ken





Bob Phillips[_6_]

Conditional compiling between Excel Versions
 
It doesn't have to be defined in every module, you can add a global
conditional constant in the project properties, General tab.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Ken Soenen" wrote in message
...
The program that I am writing using Excel 2003 is spread over many modules
and is not totally compatible with Excel 2000. I get compiler errors in

many
modules. My question is: how is this normally handled? I can use the
compiler constants #Const and its associated #IF statement to

conditionally
compile certain pieces of code, but the Constant has to be defined in

EVERY
module that you're going to use it in and then has to be manually changed
when you get the code over to the destination machine(Excel Version). It

all
seems pretty cumbersome to me. Am I missing something here?? Other than a
few brain cells!!!



thanks,

ken





Ken Soenen

Conditional compiling between Excel Versions
 
Bob,
Thanks for responding. Can you expand a bit on how to find the
"General tab". The only thing I can find is "General" under the options...
Also, couldn't see anything in the project properties window.

thanks,
ken

"Bob Phillips" wrote in message
...
It doesn't have to be defined in every module, you can add a global
conditional constant in the project properties, General tab.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Ken Soenen" wrote in message
...
The program that I am writing using Excel 2003 is spread over many
modules
and is not totally compatible with Excel 2000. I get compiler errors in

many
modules. My question is: how is this normally handled? I can use the
compiler constants #Const and its associated #IF statement to

conditionally
compile certain pieces of code, but the Constant has to be defined in

EVERY
module that you're going to use it in and then has to be manually changed
when you get the code over to the destination machine(Excel Version). It

all
seems pretty cumbersome to me. Am I missing something here?? Other than a
few brain cells!!!



thanks,

ken







Bob Phillips[_6_]

Conditional compiling between Excel Versions
 
Select the project in the project explorer within the VBIDE, and then
ToolsVBAProject Properties (assuming that you haven't renamed your
project), and on the General tab, at the bottom is a box labelled
Conditional Compilation Arguments. Add a conditional variable and value in
there.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Ken Soenen" wrote in message
...
Bob,
Thanks for responding. Can you expand a bit on how to find the
"General tab". The only thing I can find is "General" under the options...
Also, couldn't see anything in the project properties window.

thanks,
ken

"Bob Phillips" wrote in message
...
It doesn't have to be defined in every module, you can add a global
conditional constant in the project properties, General tab.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Ken Soenen" wrote in message
...
The program that I am writing using Excel 2003 is spread over many
modules
and is not totally compatible with Excel 2000. I get compiler errors in

many
modules. My question is: how is this normally handled? I can use the
compiler constants #Const and its associated #IF statement to

conditionally
compile certain pieces of code, but the Constant has to be defined in

EVERY
module that you're going to use it in and then has to be manually

changed
when you get the code over to the destination machine(Excel Version).

It
all
seems pretty cumbersome to me. Am I missing something here?? Other than

a
few brain cells!!!



thanks,

ken









Tom Ogilvy

Conditional compiling between Excel Versions
 
General is it. Does it have a textbox at the bottom named Conditional
Compilation Arguments

Note: "General" appears on one of the two "tabs"

--
Regards,
Tom Ogilvy

"Ken Soenen" wrote in message
...
Bob,
Thanks for responding. Can you expand a bit on how to find the
"General tab". The only thing I can find is "General" under the options...
Also, couldn't see anything in the project properties window.

thanks,
ken

"Bob Phillips" wrote in message
...
It doesn't have to be defined in every module, you can add a global
conditional constant in the project properties, General tab.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Ken Soenen" wrote in message
...
The program that I am writing using Excel 2003 is spread over many
modules
and is not totally compatible with Excel 2000. I get compiler errors in

many
modules. My question is: how is this normally handled? I can use the
compiler constants #Const and its associated #IF statement to

conditionally
compile certain pieces of code, but the Constant has to be defined in

EVERY
module that you're going to use it in and then has to be manually

changed
when you get the code over to the destination machine(Excel Version).

It
all
seems pretty cumbersome to me. Am I missing something here?? Other than

a
few brain cells!!!



thanks,

ken









Ken Soenen

Conditional compiling between Excel Versions
 
That does it. Thanks a bunch guys.

ken

"Bob Phillips" wrote in message
...
Select the project in the project explorer within the VBIDE, and then
ToolsVBAProject Properties (assuming that you haven't renamed your
project), and on the General tab, at the bottom is a box labelled
Conditional Compilation Arguments. Add a conditional variable and value in
there.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Ken Soenen" wrote in message
...
Bob,
Thanks for responding. Can you expand a bit on how to find the
"General tab". The only thing I can find is "General" under the
options...
Also, couldn't see anything in the project properties window.

thanks,
ken

"Bob Phillips" wrote in message
...
It doesn't have to be defined in every module, you can add a global
conditional constant in the project properties, General tab.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Ken Soenen" wrote in message
...
The program that I am writing using Excel 2003 is spread over many
modules
and is not totally compatible with Excel 2000. I get compiler errors
in
many
modules. My question is: how is this normally handled? I can use the
compiler constants #Const and its associated #IF statement to
conditionally
compile certain pieces of code, but the Constant has to be defined in
EVERY
module that you're going to use it in and then has to be manually

changed
when you get the code over to the destination machine(Excel Version).

It
all
seems pretty cumbersome to me. Am I missing something here?? Other
than

a
few brain cells!!!



thanks,

ken












All times are GMT +1. The time now is 09:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com