News: 1629362344

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Eight-year-old bug in Microsoft's 64-bit VBA prompts complaints of neglect

(2021/08/19)


A compiler bug in 64-bit Visual Basic for Applications (VBA) on Windows has existed unfixed for years, a user complained, and is blocking migration to 64-bit Office.

The problem – [1]reported by a StackOverflow user – is in code that runs correctly in 32-bit VBA but not in the 64-bit version.

There are [2]documented reasons why code may need modifying, such as Declare statements that call the Windows API, but this is not one of those.

[3]

Rather, it appears that if a class is declared including a Class_Terminate() method (VBA lingo for a destructor, called when the class is destroyed), then in some circumstances a function that should return false will instead return true.

[4]

[5]

We tried it and can confirm that while the code works as expected in 32-bit VBA, in 64-bit it does not.

[6]

The bug is easy to demonstrate in 64-bit Excel

Note that while this is a simplified example to demonstrate the bug, it is distilled from an application that worked in 32-bit VBA but broke in 64-bit. "It blocks a migration to Office 64 here, because we can not get our code out," the user said.

Bugs are a fact of life in software, so what is special about this one?

A few things. One is that a function that returns true when they should return false could have potentially calamitous consequences. If lucky, the application crashes; if unlucky, it delivers wrong results that are not immediately noticed.

Second, the bug was reported to Microsoft... years ago. This user [7]reported it in 2018.

The bug has likely existed for years, possibly since the introduction of 64-bit VBA in Office 2010.

[8]

The StackOverflow user said: "I could find this bug in all versions of Office I have, starting from 2013 and it is probably at least 8 years old."

The bug does not appear in VBA on the Mac (and we also learn that on a Mac, the compiler constant Win64 evaluates to true; there is a separate compiler constant Mac which reveals the actual operating system).

[9]Microsoft flips request to port Visual Studio Tools for Office to .NET Core from 'Sure, we'll take a look' to 'No'

[10]Stack Overflow survey: Microsoft IDEs dominate, GCP and Azure battle behind AWS

[11]The common factor in all your failed job applications: Your CV

[12]Breaking Bad or just a bad breakpoint? That feeling when your predecessor is BASIC

[13]JavaScript, GitHub, AWS crowned winners in massive survey of 32,000 developers

Although 64-bit Office has existed for a long time, many users still run 32-bit versions, despite using 64-bit Windows. The reason is that it was only in March 2019 that Microsoft [14]changed the default . Prior to that, the company felt that compatibility issues made the 32-bit version a safer choice for most users.

Office installations do not change from one architecture to the other automatically, so it is only users who have installed a fresh version of Office since then who will have 64-bit, unless they overrode the default.

The core problem is that while Microsoft [15]works energetically on code that it considers strategic, the opposite is also true.

[16]

Although Office itself remains important to the company, VBA is not, since the idea is that developers migrate to web-based add-ons that work cross-platform on desktop, mobile and in the browser.

This is why the company is [17]not attempting to migrate Visual Studio Tools for Office to .NET Core, and why VBA has stuck at version 7.x for over a decade.

From a user perspective, though, VBA is both lightweight and capable, with access to almost anything in the Office applications thanks to the COM (Component Object Model) API that they expose – and yes, this can be a security problem too, which is why documents which include macros have a different extension.

"Honestly, there are plenty of bugs in Office programs and there's no reliable way to get them fixed. I've run into several," [18]said another user, pessimistically.

The partial good news is that the StackOverflow community found a workaround. " If True = ReturnFalse(New SomeClass) Then " fixes it, another user noted. The response? "Problem is, should I invest in a development platform that has no defined process for users to report bugs, get bugs fixed or even get a list of open bugs to work around?" [19]said the original user. A question, perhaps, that is easily answered. ®

Get our [20]Tech Resources



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

[2] https://docs.microsoft.com/en-us/previous-versions/office/developer/officetalk2010/ff700513(v=office.11)

[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2YR4r354u-tpNtzOyZnfyjwAAAAI&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44YR4r354u-tpNtzOyZnfyjwAAAAI&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33YR4r354u-tpNtzOyZnfyjwAAAAI&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[6] https://regmedia.co.uk/2021/08/18/bugdemo.png

[7] https://excel.uservoice.com/forums/304921-excel-for-windows-desktop-application/suggestions/35735881-fix-inlined-member-calls-on-user-objects-on-64-bi

[8] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44YR4r354u-tpNtzOyZnfyjwAAAAI&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[9] https://www.theregister.com/2021/06/07/microsoft_vsto/

[10] https://www.theregister.com/2021/08/03/stackoverflow_developer_survey/

[11] https://www.theregister.com/2021/06/02/cv_improvement_job_search/

[12] https://www.theregister.com/2021/08/06/on_call/

[13] https://www.theregister.com/2021/07/16/jetbrains_developer_survey_2021/

[14] https://techcommunity.microsoft.com/t5/deployment/office-proplus-and-office-2019-now-install-64-bit-as-default/m-p/363394

[15] https://www.theregister.com/2021/08/16/internet_explorer_3_25th_birthday/

[16] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33YR4r354u-tpNtzOyZnfyjwAAAAI&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[17] https://www.theregister.com/2021/06/07/microsoft_vsto/

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

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

[20] https://whitepapers.theregister.com/



"[Microsoft felt] the 32-bit version a safer choice for most users"

Pascal Monett

No. Just no.

You are not a nanny, you are a company with a product. If the user buys the 64-bit version, it's his choice, not yours.

Your stupid attitude and excuses might be valid for home users, but we are talking migration here. That means business users.

It's not up to you to decide what a business actually needs. And because you're selling the same product to anyone who buys it, that means that business users can buy home versions. Sure, they shouldn't, but you're not really blocking them from doing so.

So stop deciding for your users. That despicable attitude is why Windows' behavior changes over time : you're trying to "optimize" the OS during usage, and it doesn't work. All it actually does it make the computer slower for no good reason.

My pet peeve right now is the 75 seconds it takes to open a network share and get the file contents on screen. Right at the start, it states clearly that are NNN files in the folder, but the actual file names trickle in a dozen at a time. I have an old Win7 PC and, when I open that same folder, the results are instantly displayed on my gigabit network - like they should be.

Microsoft : what the fuck are you doing ? Whatever it is, stop it !

Re: "[Microsoft felt] the 32-bit version a safer choice for most users"

Zippy´s Sausage Factory

I've found other issues with 64-bit VBA - not that one - mainly in that it can suddenly become very slow compared to 32-bit VBA. Not sure exactly how it happens, but opening a new Excel instance will be fine to run, while an old one will crawl.

Add to this the fact that they still haven't fixed a page numbering bug that's been around since Word 2.0c, and it just makes me wonder what exactly they think they're playing at with Office.

That said, they have always been high handed regarding user issues and feedback. Their approach has always been "we know best, if we say it's not an issue, it's not an issue. Now go away while we put another three buttons on the toolbar you can press by accident, all of which will risk you losing all the work you've just done over the last half hour"

Re: "[Microsoft felt] the 32-bit version a safer choice for most users"

Jon 37

Microsoft made both versions available, so users who care could choose.

Since many (most) users are non-technical and don't understand the choice, Microsoft recommended the version they thought would work best. Most users would have gone with that choice.

The idea is that developers migrate to web-based add-ons

Warm Braw

I'm not convinced that enlarging the dependency surface to include a bunch of JavaScript frameworks outside of Microsoft's control will result in greater stability.

If your organisation has migrated away from local IT provision to Office 365 or Google Workspace or whatever, how do you develop and deploy your business-specific functions in a way that preserves your investment going forward?

The shifts of Fortune test the reliability of friends.
-- Marcus Tullius Cicero