Invalid code by VBA 64-bit compiler.

This bug hits all 64-Bit VBA versions I'm aware of. Tested on Office 2013, 2016 and Office 365. Steps to reproduce:

  • Create a class module "SomeClass":

' this needs to be here to trigger the bug:

Private Sub Class_Terminate()

End Sub

  • Create a module:

Function ReturnFalse(o As Object) As Boolean
 ReturnFalse = False
End Function
Sub test()    
 Debug.Print ReturnFalse(New SomeClass)
 If ReturnFalse(New SomeClass) Then
  Debug.Print "True"
 Else
  Debug.Print "False"
 End If     
End Sub

Now, invoking "test" will print

False

False

on 32-bit VBA hosts, but:

False

True

on 64-Bit VBA hosts.

There is also a topic on stackoverflow on this bug, with further informations:

https://stackoverflow.com/questions/68034271/how-can-i-get-this-8-year-old-vba-64-bit-compiler-bug-fixed

Quote from the SO post: "I've tracked the bug down to this minimal example. Apparently, the problem seems to be, that using a temporary object (new SomeClass here) breaks the evaluation of the IF condition somehow, making it appear that the value of the condition is True not matter what."

The bug is reproducible on Access and Excel and probably every other product hosting a 64-bit VBA7 environment.

Discussion is needed on how to bring this bug to attention to the right people, because there does not seem to be a canonical way for users to report bugs of the VBA runtime.

Sorry, I don't have a 64 bit installation to test against but since you've confirmed this is problem that happens in more than one computer you should submit a "bug report" using the MS Feedback system.

*************** Feedback Hub ***************

MS Developers and Managers don’t pay much / any attention to what happens in this forum. If you have program specific issues, something you have identified as a “bug” (program not working as expected) or a “new feature request) you can use one of the 5 parallel “feedback” systems

.

Microsoft Feedback Process: Send Feedback to MS Developers

https://answers.microsoft.com/en-us/msoffice/forum/msoffice_other-msoffice_custom-msoversion_other/microsoft-feedback-process/6f850368-8c86-481d-a207-d95b265c4be4

Describes the 5 ways you can submit “Feedback” to MS

.

I’ve also (finally) recognized that there are 2 more ways of submitting “feedback” to MS for online help pages/documentation. Some, not all of their online documentation pages include 2 ways of sending “feedback” to MS to (hopefully) improve the documentation.

.

Submit Feedback about MS web Pages - Documentation

https://answers.microsoft.com/en-us/msoffice/forum/msoffice_other-msoffice_custom-msoversion_other/submit-feedback-about-ms-web-pages-documentation/97914e92-bbc7-411c-a24b-a529a6d5c42d

.

Bonus Reading related to MS Feedback system

https://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/bonus-reading-related-to-ms-feedback-system/506e7654-8ced-405b-911e-c58d8f253069

.

This article includes links to articles on topics like:

.  *  confirming that "Feedback" really is (or was) read by real people at MS

.  *  several tips on what to do or not do when asking for help

.  *  Alternate ways of getting help from MS

.  *  examples of bad customer service at other companies.

.

.
*****
.
As computer scientists we are trained to communicate with the dumbest things in the world – computers –
so you’d think we’d be able to communicate quite well with people.
Prof. Doug Fisher

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks for you reply. Regarding the 5 options described the article

#1 Feedback HUB

Tried this, but this doesn't seem to be correct. Firstly, feedback is limited to 1000 chars, so I added a link to this post to my feedback. Secondly, there is no category for problems with office or VBA, so I posted this as a developer issue, but I'm not sure if this goes anywhere.

#2 Feedback in Office

Tried that already. Yes, I've send a bug report to a frowny face.

#3 Feedback using "user voices"

Also tried that, see my SO post on this. Link is https://access.uservoice.com/forums/319956-access-desktop-application/suggestions/43660329-fix-this-64-bit-vba-compiler-bug-temporary-object

Also, here's the link of the almost three year old "uservoice" post mentioned: https://excel.uservoice.com/forums/304921-excel-for-windows-desktop-application/suggestions/35735881-fix-inlined-member-calls-on-user-objects-on-64-bi

#4 Mac Feedback

not applicable here

#5 Feedback in online apps

not applicable here

Let me express the remark here, that there should be a process for developers to hand over clean and reproductible bug reports. Forcing devs to hang around in end user forums, trying to guess, which feedback channel is the right one is intolerable.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I did say 'pick one'.

Yes, most of MS's feedback limits the amount of info. So yes, it is a good idea to include a link to a place like this where you can provide more information, such as screen captures.

.

I didn't say they are quick to act, but they do pick a few problems to act on.

.

While the feedback process is not ideal, it is better than what we had for the first 35 or so years of MS's life. At least there is somewhere we can talk to them.

.
*****
.
As computer scientists we are trained to communicate with the dumbest things in the world – computers –
so you’d think we’d be able to communicate quite well with people.
Prof. Doug Fisher

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Had the chance to run the code on a Office 365 for Mac installation , which apparently is 64-bit (and has Win64  defined in the preprocessor). *And the bug does not show up here* - so it's probably a PC thing.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 5 Applies to: