I see the problem. The code should read either:
#If VBA7 = 1 Then
or:
#If VBA7 Then
or even:
#If CBool(VBA7) = True Then
but not:
#If VBA7 = True Then