title: Set Const Conditionally at compile time in VBA
body: <p>I'd like to set the value of a const variable conditionally at Compile time.  I thought i could achieve this using vba compiler directives #If #Else etc. as below, but have been unsuccessful so far:</p>
  
  <pre><code>#If Environ("username") = "myusername" Then
      Public Const ErrorHandling As Boolean = False
  #Else
      Public Const ErrorHandling As Boolean = True
  #End If
  </code></pre>
  
  <p>When i run this code, im getting an error that the Environ variable is undefined.<br>Would something like this even be possible? Or do i just have to make my 'ErrorHandling' variable Public (not Const), and set it at the initialisation of my code?<br><br> Thanks in advance,<br>cjk</p>