This class, which runs just fine contains lines like #Const UseScriptingDictionaryIfAvailable = True. I normally use Const UseScriptingDictionaryIfAvailable As Boolean = True.
I've noticed you can't explicitly declare the type with #const. Whereas As Boolean is optional in the later, its forbidden in the former. Is that the only difference? Is there an internal difference?
That # is for conditional compilation. If you want to conditionally compile a certain piece of code, you can use #. For example:
#Const MyEnv = "Testing"
Sub TestMacro()
#If MyEnv = "Testing" Then
' do something here
Debug.Print "Logging for testing"
Dim X as String
X = "..."
#Else
Dim Y as Int
Y = 100
#End If
End Sub
https://usefulgyaan.wordpress.com/2013/06/26/vba-trick-of-the-week-conditional-compiling/ link provides a good description of conditional compilation.
http://www.utteraccess.com/wiki/index.php/Conditional_Compilation also provides some good inputs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With