project wide compconditional compile constants

  • Thread starter Thread starter Erich Neuwirth
  • Start date Start date
E

Erich Neuwirth

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
 
at the top of a Module put in something like this
Public Const MyConst As String = "MyString"
 
Erich Neuwirth said:
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 *
 
#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?
 
Erich Neuwirth said:
#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 *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top