Hello, All,
I'm trying to use Option Explicit alongside preprocessor constants, like in the dummy code below:
When I try to run TEST_MOD, I get a "Compile Error: Variable not defined." It does the same thing if I put Option Explicit above the #Const declaration. Do preprocessor constants not work with Option Explicit in this way?
I'm trying to use Option Explicit alongside preprocessor constants, like in the dummy code below:
VBA Code:
Option Explicit
#Const TEST_CONST = 123
Sub TEST_MOD()
Debug.Print TEST_CONST
End Sub
When I try to run TEST_MOD, I get a "Compile Error: Variable not defined." It does the same thing if I put Option Explicit above the #Const declaration. Do preprocessor constants not work with Option Explicit in this way?