Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Project Explorer - Properties - Compiler Constants 1

Status
Not open for further replies.

TomCarnahan

Programmer
Dec 7, 2002
123
US
Does anyone know how to use the the one text box
called "Compiler Constants" that you get when you go into the VBE, select a project in the Project Explorer, right-click and select Properties?

I have looke through a lot of material and help files and can't seem to find answers. The Help files don't seem to tell you what it's function is.

Thanks...

--- Tom
 
If we're talking about the same thing, it's used for storing info about your project for future reference. You can also assign help files here and lock the VBA code from future edit with a password.
 
If I click the "Help" button in the same dialog box, it tells me:

"Lists the constant declarations used for conditional compilation."
 
So.... follow the clue and look in the help file under "conditional compiling"

It's a way to make global (public) conditional comilation constants. For example if you put this in the properties box:
[blue]
Code:
MYDEBUG = 1 : YOURDEBUG = 0
[/color]

and put this in a code module:
[blue][/code]
Option Explicit
Sub test()
#If MYDEBUG Then
MsgBox "MYDEBUG"
#End If
#If YOURDEBUG Then
MsgBox "YOURDEBUG"
#End If
End Sub
[/code][/color]

and then do a little experimenting, you should see how it works.
 
Zathras,

I have used Compiler Constants before, but I thought they were only scoped to the module level. This is the first time I've seen where it could be globally scoped.

I tried this and it works GREAT!!!

MANY THANKS for turning on the light! [sunshine]

--- Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top