ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   project wide compconditional compile constants (https://www.excelbanter.com/excel-programming/298489-project-wide-compconditional-compile-constants.html)

Erich Neuwirth

project wide compconditional compile constants
 
The docs mention that it is possible to define
compiler constants for a whole project, not just for one module.
I could not find how this can be done.
Can anybody tell me?

Erich Neuwirth

Chris

project wide compconditional compile constants
 
at the top of a Module put in something like this
Public Const MyConst As String = "MyString"

Rob Bovey

project wide compconditional compile constants
 
"Erich Neuwirth" wrote in message
...
The docs mention that it is possible to define
compiler constants for a whole project, not just for one module.
I could not find how this can be done.
Can anybody tell me?


Hi Erich,

From the VBE menu select Tools/<VBAProject Properties, where
<VBAProject is the actual name of your project. The bottom textbox on the
General tab allows you to define global conditional compilation constants.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *




Erich Neuwirth

project wide compconditional compile constants
 
#Const LocalExternalServer = True
is what I currently have in a module.
I would like to have this global,
but when I try to enter
LocalExternalServer = True
as described below,
it does not work.
I get
invalid syntax for constant declarations.

Are only integer constants allowed there?

Rob Bovey wrote:

"Erich Neuwirth" wrote in message
...

The docs mention that it is possible to define
compiler constants for a whole project, not just for one module.
I could not find how this can be done.
Can anybody tell me?



Hi Erich,

From the VBE menu select Tools/<VBAProject Properties, where
<VBAProject is the actual name of your project. The bottom textbox on the
General tab allows you to define global conditional compilation constants.


Rob Bovey

project wide compconditional compile constants
 
"Erich Neuwirth" wrote in message
...
#Const LocalExternalServer = True
is what I currently have in a module.
I would like to have this global,
but when I try to enter
LocalExternalServer = True
as described below,
it does not work.
I get
invalid syntax for constant declarations.

Are only integer constants allowed there?


Hi Erich,

Yes, that's correct. Sorry I forgot to mention it. Zero = False and
non-zero = True. You can define multiple constants by using a colon as a
separator.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *




All times are GMT +1. The time now is 04:15 AM.

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