How can I get this 8 year old VBA 64-bit compiler bug fixed?

13,457

Solution 1

Sub Test()
    Debug.Print ReturnFalse(New SomeClass)

    If ReturnFalse(New SomeClass) Then
        Debug.Print True
    Else
        Debug.Print False
    End If
    
    If True = ReturnFalse(New SomeClass) Then
        Debug.Print True
    Else
        Debug.Print False
    End If
End Sub

Returns

False
True
False

So If True = ReturnFalse(New SomeClass) Then fixes it

And for the loop this fixes it too

Do While True = ReturnFalse(New SomeClass)
    Debug.Print "Oh no!"
    Exit Do
Loop

Highly recommended to comment every usage of the workaround above so nobody removes that True = in the future (eg. because he develops in 32 bit and does not even run into the issue).

' Don't remove `True =` due to a compiler bug in x64 the condition would always be true. 
' See https://stackoverflow.com/questions/68034271/how-can-i-get-this-8-year-old-vba-64-bit-compiler-bug-fixed
If True = ReturnFalse(New SomeClass) Then

Even If ReturnFalse(New SomeClass) And False = True Then would be True with this bug.

Solution 2

You can't do much more than what you have done already, unless you want to reach out to the tech devs directly/individually and risk getting on the annoying list, which would not necessarily help the chances of getting it actually fixed.

Uservoice is headed for the scrap heap but it does still get noticed and used by the product dev team, including right now in 2021.

VBA is not the current focus for programmability development, so I do not have a large amount of confidence that this will make it to the priority queue.

Share:
13,457
Nordic Mainframe
Author by

Nordic Mainframe

"^_^"

Updated on June 04, 2022

Comments