Bug in Excel VBA (Mac)(Debug Mode + ANY Floating Point Operation => Overflow error)

  • Since couple of days, I am encountering a serious issue with Excel when I do anything in debug mode. Appreciate if anyone can shed a light on it - or at least confirm that they can reproduce it (not sure if this is reproducible on windows Excel). I'm beginning to think it is a bug in Excel and hoping that the next version will fix it. I had no luck trying to find a way to report directly to Microsoft. Posting to a TechCommunity forum under a microsoft domain didn't help either.


    Issue: When any VBA macro is run in debug mode (or it goes through a debug.print statement in normal mode), the first time it encounters a floating point operation, it results in a "Overflow" error.


    Excel Versions: Excel 16.29.1 (19091700). (Also replicated on different versions from 16.24 to 16.29. (Not reproduced in 16.23))
    OS: Mac OS 10.14 to 10.14.6 (Mojave)


    Problem Repeats when:

    • Program enters debug mode via a breakpoint - OR - program encounters first debug.print call
    • Any subsequent operation that accesses a variable declared as single/double, or any math that implicitly or explicitly invokes a floating point operation (division, power etc.) results in an Overflow error.

    What I tried: Tried on different machines with slightly different Excel versions and OS versions. Tried removing all Add-Ins, restart computer, close all other applications etc.


    Code below contains methods that reproduce the error and minor variants of the same method that do not produce the error.


    Any feedback is greatly appreciated.


    Regards


    Krishna