My code is as follows:
#Const debuggingEnabled = False
Sub debugMessage(str As String)
#If debuggingEnabled Then
Debug.Print str
#End If
End Sub
Sub doThings()
debugMessage "test" 'Does this get optimised away, or must it be explicitly
'wrapped with `#If .. #End If` every time it's called
'if one is to avoid the jump and stack push/pop ops?
End Sub
Does Microsoft's VBA compiler optimise away calls to procedures that do nothing? How can I find out?